Social Intents Chat Event Listener
How to track Social Intents Chat Interaction with google tag manager
User interactions with your Social Intents Livechat software can be tracked into your Analytics stacks (Google Analytics, Piwik Pro, Mixpanel, etc.) using Google Tag Manager and the Social Intent event listener.
With this data in your measurement platform, you’ll have valuable insights into what impact these interactions have on your marketing funnel, conversions, website engagement metrics, and other business KPIs.
Your first step will be to copy, and paste the Social Intents 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 Social Intents script through Google Tag Manager, please use the DOM-ready or Window Loaded trigger instead.
In the next step you should create the [socialIntents_Action] custom events, which is triggered on every interaction with the embedded livechat widget.
DataLayer variable with the key [chatAction] should be created for you to capture in GTM, the Social Intents event type.
[chatAction] returns the following event description;
- chat window closed
- chat window opened
- chat session ended
You can use the [chatAction] dataLayer variable as an event parameter or for streamlining your trigger to fire on specific Social Intents chat interactions.
To complete the implementation, you’ll need to add your marketing tags, attach the Social Intents trigger [socialIntents_Action] to it, and use the dataLayer variables you created to push more information about each interaction.
<script> function onSIApiReady() { //Will trigger when chat window is minimized SI_API.onChatClosed = function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'socialIntents_Action', 'chatAction': 'chat window closed' }); //Will trigger when chat window appears SI_API.onChatOpened = function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'socialIntents_Action', 'chatAction': 'chat window opened' }); }; //Will trigger when chat window is minimized SI_API.onChatEnded = function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'socialIntents_Action', 'chatAction': 'chat session ended' }); }; }; }; </script>