Poptin GTM Event Listener
Track Poptin popup interactions in GTM. Monitor display, close, form submission, and conversion events with popupAction and poptinID variables.
poptinpopuplead-generationgtmga4email-captureexit-intent
Event fired
poptinPopUpEventKey variable
popupActionPoptin
Overview
Poptin is a popup and form builder for lead generation, offering exit-intent popups, overlays, slide-ins, and embedded forms. This listener hooks into Poptin's JavaScript event system to track popup interactions.
Event fired: poptinPopUpEvent
Variables: popupAction, poptinID
Why Use This Listener
Popup conversion rates are a key metric for lead generation. This listener tells you not just how many forms were submitted, but how many popups were shown, how many were dismissed, and what the conversion rate per popup is.
Tracked Events
| popupAction | Description |
|---|---|
popup displayed | Popup shown to visitor |
popup closed | Popup dismissed |
form submitted | Popup form completed |
button clicked | CTA button clicked |
exit intent triggered | Exit-intent fired |
Installation
html
<!-- GTM Custom HTML Tag: Poptin Listener -->
<script>
(function() {
function poptinPush(action, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({
'event': 'poptinPopUpEvent',
'popupAction': action
}, extra || {}));
}
document.addEventListener('poptinLoaded', function(e) {
poptinPush('popup displayed', { poptinID: e.detail && e.detail.id });
});
document.addEventListener('poptinClosed', function(e) {
poptinPush('popup closed', { poptinID: e.detail && e.detail.id });
});
document.addEventListener('poptinFormSubmitted', function(e) {
poptinPush('form submitted', { poptinID: e.detail && e.detail.id });
});
document.addEventListener('poptinButtonClicked', function(e) {
poptinPush('button clicked', { poptinID: e.detail && e.detail.id });
});
})();
</script>Data Layer Output
json
{
"event": "poptinPopUpEvent",
"popupAction": "form submitted",
"poptinID": "poptin_abc123"
}Trigger Configuration
Trigger: Custom Event | poptinPopUpEvent
Conversion only:
Condition: DLV – Poptin Action | equals | form submitted
Variables to Capture
| Variable Name | DL Key | Example |
|---|---|---|
| DLV – Poptin Action | popupAction | "form submitted" |
| DLV – Poptin ID | poptinID | "poptin_abc123" |
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
view_promotion | popup displayed | popup_id, popup_name |
generate_lead | form submitted | popup_id, method: "poptin" |
Best Practices
- Track impression-to-submission ratio per
poptinIDin GA4 to measure popup effectiveness - Use
popupAction = popup closedwith session data to analyze exit patterns - Create separate conversion events for exit-intent vs. time-delay popups