Button Actions
All the different actions a button can perform, controlled by the href parameter.
Actions Overview
| Action | href Pattern | Additional Params |
|---|---|---|
| Submit Form | #submit-form |
- |
| External Link | https://... |
target: "_blank" or "_self" |
| One-Click Upsell | #submit-oto |
- |
| Scroll To | #scroll-id-{elementId} |
- |
| Show/Hide | #show-hide |
showIds, hideIds, data-elbuttontype |
| Open Popup | #open-popup |
- |
| Close Popup | #close-popup |
- |
| Next Funnel Step | ?next_funnel_step=true |
- |
Submit Form
Submit the page form (opt-in, contact, etc.):
JSON
{
"type": "Button/V1",
"params": {
"href": "#submit-form",
"target": "_self"
}
}
External Link
Open a URL in same tab or new tab:
JSON - New Tab
{
"type": "Button/V1",
"params": {
"href": "https://www.example.com",
"target": "_blank"
}
}
JSON - Same Tab
{
"type": "Button/V1",
"params": {
"href": "https://www.example.com",
"target": "_self"
}
}
One-Click Upsell
Process a one-click upsell (on OTO pages):
JSON
{
"type": "Button/V1",
"params": {
"href": "#submit-oto",
"target": "_self"
}
}
Scroll To Element
Smooth scroll to another element on the page:
JSON
{
"type": "Button/V1",
"params": {
"href": "#scroll-id-6Z-TargetElement-0",
"target": "_self"
}
}
i
Tip: Use the element's ID in the format
#scroll-id-{elementId}.
Show/Hide Elements
Toggle visibility of elements on the page:
JSON
{
"type": "Button/V1",
"params": {
"href": "#show-hide",
"target": "_self",
"showIds": "id-6Z-Element1-0",
"hideIds": "id-6Z-Element2-0"
},
"attrs": {
"data-elbuttontype": "showHide"
}
}
!
Important: Element IDs in
showIds and hideIds use the format id-{elementId}. Separate multiple IDs with commas.
Multiple Elements
JSON
{
"params": {
"href": "#show-hide",
"showIds": "id-6Z-Elem1-0,id-6Z-Elem2-0",
"hideIds": "id-6Z-Elem3-0,id-6Z-Elem4-0"
},
"attrs": {
"data-elbuttontype": "showHide"
}
}
Open Popup
Open the page's popup modal:
JSON
{
"type": "Button/V1",
"params": {
"href": "#open-popup",
"target": "_self"
}
}
Close Popup
Close the popup (use inside the popup):
JSON
{
"type": "Button/V1",
"params": {
"href": "#close-popup",
"target": "_self"
}
}
Next Funnel Step
Navigate to the next step in the funnel:
JSON
{
"type": "Button/V1",
"params": {
"href": "?next_funnel_step=true",
"target": "_self"
}
}
Image Links
Images can also trigger actions using data-element-link:
JSON
{
"type": "Image/V2",
"selectors": {
".elImage": {
"attrs": {
"data-element-link": "#open-popup"
}
}
}
}