GetSiteControl Event Listener
How to track GetSiteControl Pop Up Interactions with google tag manager
Enhance the data in your measurement stacks (Google Analytics, Piwik Pro, Mixpanel, etc.) with GetSiteControl pop-up impressions, closes, and conversion data.
With this data, you can have valuable insights into what impact these interactions have on your marketing funnel, conversions, website engagement metrics, and other business KPIs.
Google Tag Manager, and the GetSiteControl event listener script, will be needed for this implementation.
Your first step will be to copy, and paste the event listener script in the GTM custom HTML tag and fire it on pageview or DOM ready (always recommended).
PRO TIP: if you installed the GetSiteControl script through Google Tag Manager, please use the DOM-ready trigger instead.
Your next step should be creating the following list of custom events;
- [GSC_Impression] ->which happens on a GetSiteControl pop-up is displayed.
- [GSC_Close] ->which fires when the user closes a GetSiteControl pop-up widget.
- [getSiteControlConv] ->which happens when a lead is generated through the widget.
You’ll need to create a DataLayer variable with the key [widgetId], this variable pull the widget ID that helps us identify the widget that is emitting that event.
Connect your marketing tags to the trigger and use the dataLayer variables you created to push more information about each GetSiteControl widget interaction.
<script> gsc('onShow', function(widgetId, data) { window.dataLayer.push({ 'event': 'GSC_Impression', 'widgetId': widgetId }); }); gsc('onClose', function(widgetId, data) { window.dataLayer.push({ 'event': 'GSC_Close', 'widgetId': widgetId }); }); gsc('onSubmit', function(widgetId, data) { window.dataLayer.push({ 'event': 'getSiteControlConv', 'widgetId': widgetId, 'formData': data }); }); </script>