How to Measure Chat Quality in Your Website Analytics

ListenLayer allows you to easily track all of your website chat activity across multiple marketing platforms. Once you have those basics down, you can start applying more advanced rules for filtering, segmenting, and enhancing your data. One recommendation is to limit your chat conversions to focus only on "High Quality" chats based on the number of messages sent from a user.

Tracking Only High-Quality Chats

Segment your chat conversion tracking and data collection based on quality. Set a threshold on the number of messages a user sends in order to measure and segment by quality.

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 Hubspot Chat.

Don’t forget to publish your ListenLayer changes!

Step 4: Enable Custom Data Layer Values
Step 4: Enable Custom Data Layer Values

Stay on the Listener’s Features screen but navigate to the Customization & Storage features. Enable the feature called Custom Data Layer Values.

Step 5: Create a Custom Data Layer Variable
Step 5: Create a Custom Data Layer Variable

Create a variable on the Global Data Layer Variables screen that you will use to define chat quality. In this example, we are using a variable called qualityChat.

Step 6: Create a Custom Value Rule
Step 6: Create a Custom Value Rule

Navigate to Custom Values under the Listener. Create a Simple Rule and define your specific conditions. In this example, we want a specific event and variable to be pushed into the data layer in order to define another value in the data layer.  We are focused primarily on the Number of User Messages being equal to 3.

Step 7: Define You Data Layer Value
Step 7: Define You Data Layer Value

As you complete your rule, define the value you want to push into the data layer when the condition is met.

Make sure to publish your change!

Step 8: Test Your Data Layer Activity
Step 8: Test Your Data Layer Activity

Test a chat on your website and make sure the rule is pushing the high-quality chat indicator into the data layer.  You can see here that we have hit the threshold of 3 messages from the user, and we have a value under chatCustomValues.qualityChat equal to “High.”

Step 9: Create a Custom Variable Inside GTM
Step 9: Create a Custom Variable Inside GTM

Capture the qualityChat variable inside GTM so that it can be made available to triggers and tags.  Select Data Layer Variable as the variable type, and set the name to be the path to the variable. In this case, the path is chatCustomValues.qualityChat.

Step 10: Create an Event Trigger inside GTM
Step 10: Create an Event Trigger inside GTM

Inside of Google Tag Manager, create a new Trigger and select the Custom Event trigger type. Paste the name of the chat event from the data layer. In this case, we are targeting the event called hschatMessagefromUser. Limit the scope of this trigger to only fire when chat quality (the variable we created in the step above) contains “High.”

 

hschatMessagefromUser
Step 11: Create Your Conversion Tags
Step 11: Create Your Conversion Tags

In Google Tag Manager, set your chat tags to fires based on the trigger we created in the step before this. If you need to, create new tags. Now you can send High-Quality chat conversions to all of your marketing platforms easily.