Articles on: Integrations

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

Event AttributePurpose of Event
detail.poptin_idUnique Popup/Form ID
detail.poptin_nameName of the Popup/Form as in Poptin Dashboard
detail.poptin_targetPossible values: lead/click /social_proof
detail.poptin_typePopup Type e.g Bar, Sidebar, Lightbox, Mobile, FullScreen
detail.account_idPoptin User Account ID
detail.event_namepoptinView / poptinClose / poptinSubmit / couponCopy
detail.button_textWhen Submit button or a Link button is clicked.
detail.coupon_codeWhen the Coupon Code button is clicked or the code is copied.
detail.prize_labelPrize Label - Available only in gamified popups when the user wins.
detail.shopifyWhen a Shopify Product Recommendation button is clicked
detail.shopify.button_textRecommendation button's text
detail.shopify.product_urlProduct's full URL with variation
detail.shopify.product_nameProduct's name
detail.shopify.product_idProduct's Unique ID
detail.shopify.variant_idProduct's Unique variation ID
detail.shopify.buttons_actionAction 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

Was this article helpful?

Share your feedback

Cancel

Thank you!