How to Segment Sales & Support Chats In Your Website Analytics

ListenLayer makes chat tracking so easy that you'll finally have time to implement some advanced data collection. Why not start by segmenting out your sales and support chat conversations so that your marketing team can focus on what matters: sales?

Creating Separate Conversions for Sales Chats and Support Chats

Use characteristics from your chat conversations to segment out your web analytics data.

Steps & Code Examples

Step 1: Add Your Domain Name Inside ListenLayer
Step 1: Add Your Domain Name Inside ListenLayer

Navigate to the Website screen of your ListenLayer account and add your website domain name. Then copy the Website Script to place on your website using Google Tag Manager.

Step 2: Deploy Your ListenLayer Website Script
Step 2: Deploy Your ListenLayer Website Script

Create a Custom HTML Tag inside of Google Tag Manager that fires on All Pages. Place the tracking script from your ListenLayer account. A sample is shown here, but you must use the code from your account, not this example code!

<script type="text/javascript">(function(c,a,d,b,e) {c[b] = c[b] || [];
c=a.getElementsByTagName(d)[0];a=a.createElement(d);b="dataLayer"!= b ?"&l="+b:"";a.async = !0;
a.src = "https://assets.listenlayer.com/datalayer.min.js?id="+e+b;
c.parentNode.insertBefore(a,c)})(window,document,"script","dataLayer",
"00000000-0000-0000-0000-0000000000000");</script>
Step 3: Enable Your Chat Listener & Features
Step 3: Enable Your Chat Listener & Features

Enable the Listener for your website chat system by navigating to the Listener Library. Once the Listener is enabled, navigate to the Features screen inside the Listener and enable the Chat Activity features.  In this example, we are using LiveChat.

Don’t forget to publish your ListenLayer changes!

Step 4: Test Your Chat and Learn How the Data Layer Works
Step 4: Test Your Chat and Learn How the Data Layer Works

Once you’ve published your Listener, start testing chat on your live website and learn how the data layer events behave. Each chat system is slightly different.

Here we are using LiveChat, which allows us to capture information from the initial form. Many tools also allow us to push conversation data into the data layer. Decide what types of information you can use to segment out sales from support chats.

Step 5: Create Variables in GTM
Step 5: Create Variables in GTM

Create a variable in GTM to capture the piece of data you will use to segment out your chat activity by type. For example, here, we capture the value of a file that the user selects when they begin their chat.

When creating the variable, select “Data Layer Variable” as the type, and set the name equal to the path that leads to the variable in the data layer.  Watch the video above if you need a more detailed explanation of how the path works. We’ve included this variable’s path in the code example here.

chatAutomaticValues.formFieldValues.whatCanWeHelpYouWith.value
Step 6: Create Triggers in GTM
Step 6: Create Triggers in GTM

Use Google Tag Manager to create a trigger that focuses on the event name. For example, we know that our “sales vs. chat” data is collected during the event called livechatUserEnteredEmail, so we create a Custom Event trigger with an Event name equal to this.

Now, limit the scope of this trigger to only fire when the “Chat Type” variable from the previous step is equal to Sales.

livechatUserEnteredEmail
Step 7: Create Your Conversion Tags
Step 7: Create Your Conversion Tags

Now that we have a trigger firing on chat starts for sales, we can set up our conversion tags in Google Tag Manager to fire only when this trigger occurs.