Zoho Sales IQ Event Listener
How to track Zoho Sales IQ Chat Interactions with google tag manager
The Zoho Sales IQ chat event listener provided on this resource page can be used in Tag Managers like Google Tag Manager, Piwik Pro Tag Manager, and others to track website visitor interactions with the Zoho Sales IQ chat widget embedded on your website.
Here’s how you can set it up:
1. Create a Custom HTML Tag:
- Create a new custom HTML tag in Google Tag Manager (GTM).
- Copy and paste the Zoho Sales IQ chat event listener script into this tag.
- Add a trigger to the tag. It’s recommended to use a DOM Ready trigger, ensuring the trigger fires only after the Zoho Sales IQ chat widget has fully loaded on your website.
- Name the tag and save it.
The Zoho Sales IQ chat event listener emits dataLayer events named “[zoho_sales_IQ_event]” for every chat widget interaction it tracks. You’ll use this in the next steps.
2. Create a Custom Event Trigger:
- Next, create a custom event trigger in GTM.
- Use “[zoho_sales_IQ_event]“ as the event name in the trigger configuration.
- Name the trigger and save it for later use.
3. Define DataLayer Variables:
- To determine the specific type of interaction with the Zoho Sales IQ chat widget, create dataLayer variables.
- The first variable should be of the dataLayer variable type with the key “[action]“. This variable will return different values depending on the type of chat widget engagement, such as:
- “chatbutton_click“: When the Zoho Sales IQ chat widget is clicked.
- “floatbutton_click“: When the float button is clicked.
- “floatwindow_minimize“: When the chat window is minimized.
- “floatwindow_close“: When the chat float is closed.
- “visitor_chat“: When a visitor initiates a chat.
- “agent_message“: When a chat agent sends a message.
- “visitor_feedbac“`: When a visitor leaves feedback about their chat experience.
- “visitor_rating“: When a visitor rates their chat experience.
4. Additional DataLayer Variables:
These other dataLayer variables are not available on all the Zoho Sales IQ chat dataLayer events; creating them and capturing them in their associated event will help you add additional dataLayer variables for more context:
- [visitid]: The visitor ID.
- [agentMessage]: The chat agent’s message.
- [feedback]: Feedback provided by the user.
- [agent]: The agent’s name.
- [rating]: The chat rating.
5. Collect Interaction Data In Analytics:
Create a new tag for your GA4 event tag or Piwik Pro custom event tag, and use the Zoho Sales IQ events to fire the analytics tag and the dataLayer variables to enrich the Zoho Sales IQ chat interactions event in analytics tools like Google Analytics (GA4), Piwik Pro, etc.
To simplify and speed up the implementation process, scroll down this resource page to find a Google Tag Manager recipe template that you can download and use.
<script> // Listen for the chat button click event $zoho.salesiq.chatbutton.click(function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "chatbutton_click" }); }); // Listen for the float button click event $zoho.salesiq.floatbutton.click(function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "floatbutton_click" }); }); // Listen for the float window minimize event $zoho.salesiq.floatwindow.minimize(function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "floatwindow_minimize" }); }); // Listen for the float window close event $zoho.salesiq.floatwindow.close(function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "floatwindow_close" }); }); // Listen for the visitor chat initiation event $zoho.salesiq.visitor.chat(function(visitid, data) { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "visitor_chat", visitid: visitid, visitorName: data.name, visitorEmail: data.email, visitorQuestion: data.question }); }); // Listen for the agent message event $zoho.salesiq.chat.agentMessage(function(visitid, data) { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "agent_message", visitid: visitid, agentMessage: data.message }); }); // Listen for the visitor feedback event $zoho.salesiq.visitor.feedback(function(visitid, data) { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "visitor_feedback", visitid: visitid, feedback: data.feedback, agent: data.agent }); }); // Listen for the visitor rating event $zoho.salesiq.visitor.rating(function(visitid, data) { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "zoho_sales_IQ_event", action: "visitor_rating", visitid: visitid, agent: data.agent, rating: data.rating }); }); </script>