<\/figure><\/div>\n\n\nTracking Poptin forms with GA4 using GTM<\/h2>\n\n\n\n Now that you have Poptin set up on your site you will likely want to track interactions with it. To achieve this, we will need to create several tags, triggers and variables.<\/p>\n\n\n\n
Tag: Poptin event listener<\/h3>\n\n\n\n To track the Poptin popup we will add a Custom HTML snippet that listens to any interaction with the popups.<\/p>\n\n\n\n
Simply create a new tag of the type Custom HTML and paste in the script below.<\/p>\n\n\n\n
<script>\nvar poptinDataLayer = function(event) {\r\n dataLayer.push({\r\n event: event.detail.event_name,\r\n poptin_name: event.detail.poptin_name,\r\n poptin_id: event.detail.poptin_id,\r\n poptin_target: event.detail.poptin_target,\r\n poptin_type: event.detail.poptin_type\r\n })\r\n};\r\n\r\ndocument.addEventListener(\"poptinView\", poptinDataLayer, false);\r\ndocument.addEventListener(\"poptinClose\", poptinDataLayer, false);\r\ndocument.addEventListener(\"poptinSubmit\", poptinDataLayer, false);\n<\/script> <\/code><\/pre>\n\n\n\nSet this tag to trigger on “All Pages”.<\/p>\n\n\n
\n
<\/figure><\/div>\n\n\nPoptin Variables<\/h3>\n\n\n\n Create new variable to be used in the GA4 event.<\/p>\n\n\n\n
\nCreate a new variable of the type Data Layer Variable<\/li>\n\n\n\n Set the Data Layer Variable name to poptin_name<\/code><\/li>\n\n\n\nSet the variable name to “poptin_name” and save it<\/li>\n<\/ol>\n\n\n\n
<\/figure><\/div>\n\n\nRepeat for the following variables:<\/p>\n\n\n\n
\npoptin_id<\/li>\n\n\n\n poptin_target<\/li>\n\n\n\n poptin_type<\/li>\n<\/ol>\n\n\n\nTag: Poptin GA4 event<\/h3>\n\n\n\n Next, we will create the GA4 event.<\/p>\n\n\n\n
\nCreate a new tag of the type GA4 Event<\/li>\n\n\n\n Set the Configuration Tag to the existing tag in the container<\/li>\n\n\n\n Set the Event Name to {{Event}}<\/code><\/li>\n\n\n\nUnder Event Parameters, add new parameters: poptin_name poptin_id poptin_target poptin_type<\/li>\n\n\n\n Pair each parameter with the matching variable (created in the previous step) by clicking the lego brick next to the value<\/li>\n<\/ol>\n\n\n\n
<\/figure><\/div>\n\n\nPoptin Trigger<\/h3>\n\n\n\n Finally, create a new trigger of the type Custom Event.<\/p>\n\n\n\n
Set the Event Name to poptinView|poptinClose|poptinSubmit<\/code> and check the “Use regex matching” box.<\/p>\n\n\n\n
<\/figure><\/div>\n\n\nAdd this trigger to the Poptin GA4 Tag and you’re all set.<\/p>\n\n\n\n
Completing the setup in GA4<\/h2>\n\n\n\n After you’ve created the setup in GTM, you will need to make sure GA4 is able to collect the data sent.<\/p>\n\n\n\n
Configuring Custom Dimensions<\/h3>\n\n\n\n In order for the Event Parameters you’ve added to the GA4 tag to be reported in GTM properly, you need to set up matching Custom Dimensions in GA4.<\/p>\n\n\n\n
To create a new custom dimension, open the relevant GA4 account and navigate to the Admin tab.<\/p>\n\n\n\n
In the middle column, click on Custom Definitions.<\/p>\n\n\n\n
Under the Custom Dimensions tab, click Create Custom Dimensions.<\/p>\n\n\n\n
Set the Dimension Name to a friendly name, e.g. Poptin Form Name, and set the event parameter to the equivalent event parameter from GTM, e.g. poptin_name.<\/p>\n\n\n
\n
<\/figure><\/div>\n\n\nRepeat for all the event parameters sent (poptin_id, poptin_target & poptin_type).<\/p>\n\n\n\n
Setting up conversions<\/h3>\n\n\n\n Last, but definitely not least, is configuring Poptin submissions as conversions.<\/p>\n\n\n\n
While it’s optional to wait for events to come in and then set the conversion by toggling them on in the event stream, I like to take a proactive approach to set these up in advance.<\/p>\n\n\n\n
Simple navigate to the Conversions page (also in the Admin tab.<\/p>\n\n\n\n
Click on New Conversion Event and paste in poptinSubmit<\/code><\/p>\n\n\n\n
<\/figure><\/div>","protected":false},"excerpt":{"rendered":"One of my favorite tools for lead capture is Poptin. Besides being a great tool with fantastic functionality, it also features two great founders, Tomer and Gal, who I can personally say have influenced much of the work I do as a marketer. Integrating Poptin using Google Tag Manager To add Poptin to your site […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,39],"tags":[],"class_list":["post-5552","post","type-post","status-publish","format-standard","hentry","category-google-analytics","category-google-tag-manager"],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=5552"}],"version-history":[{"count":3,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5552\/revisions"}],"predecessor-version":[{"id":5607,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5552\/revisions\/5607"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=5552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=5552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=5552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}