DOM Events - How it works
Poptin has different DOM Events that are automatically fired on different actions on your popups and forms. You can use tools such as Google Tag Manager to listen for the automatically fired DOM events and capture the data.
poptinView : This event is fired when a poptin / form is viewed
poptinClose : This event is fired when a poptin is closed either from the X button or from the Close button
poptinSubmit : This event is fired when a poptin / form is submitted either from the Submit button or a Link button with "Count as Conversion" checked in poptin dashboard
couponCopy : This event is fired when a coupon button is clicked
You can test by using a test listener just as mentioned below.
If you want to create a data layer, have a look at this guide by Elad Levi >>
poptinView : This event is fired when a poptin / form is viewed
poptinClose : This event is fired when a poptin is closed either from the X button or from the Close button
poptinSubmit : This event is fired when a poptin / form is submitted either from the Submit button or a Link button with "Count as Conversion" checked in poptin dashboard
couponCopy : This event is fired when a coupon button is clicked
Event Attribute | Purpose of Event |
---|---|
detail.poptin_id | Unique Popup/Form ID |
detail.poptin_name | Name of the Popup/Form as in Poptin Dashboard |
detail.poptin_target | Possible values: lead/click /social_proof |
detail.poptin_type | Popup Type e.g Bar, Sidebar, Lightbox, Mobile, FullScreen |
detail.account_id | Poptin User Account ID |
detail.event_name | poptinView / poptinClose / poptinSubmit / couponCopy |
detail.button_text | When Submit button or a Link button is clicked. |
detail.coupon_code | When the Coupon Code button is clicked or the code is copied. |
detail.prize_label | Prize Label - Available only in gamified popups when the user wins. |
detail.shopify | When a Shopify Product Recommendation button is clicked |
detail.shopify.button_text | Recommendation button's text |
detail.shopify.product_url | Product's full URL with variation |
detail.shopify.product_name | Product's name |
detail.shopify.product_id | Product's Unique ID |
detail.shopify.variant_id | Product's Unique variation ID |
detail.shopify.buttons_action | Action to take when the button is clicked ( as set in Poptin Dashboard ) |
You can test by using a test listener just as mentioned below.
<script>
document.addEventListener("poptinSubmit", function(event){
console.log(event.detail);
}, false);
</script>
If you want to create a data layer, have a look at this guide by Elad Levi >>
Updated on: 15/11/2024
Thank you!