HubSpot Chat Data Layers

Our custom Listeners make it easy to generate data layers for tracking your HubSpot Chats. Check out the samples below and get started for free!

HubSpot Chat Data Layer Examples

Learn more about how ListenLayer generates powerful data layers from the activity on your website, specifically from HubSpot Chats.

Custom Data Layer Events

Generate automatic data layer events, like the ones shown here, when users interact with HubSpot Chats on your website. For example, collect data and or trigger conversions (using GTM) any time a user begins a chat, sends a message, enters their email, or a chat agent responds.

This Listener allows you to accurately and easily define and track conversions based on your HubSpot Chat tracking needs.


event: 'hschatStarted',

event: 'hschatMessageFromAgent',

event: 'hschatMessageFromUser',

event: 'hschatUserEnteredEmail'

Automatic Data Layer Values

ListenLayer pushes critical information from your HubSpot Chat activity into the data layer automatically. For example, this code to the right shows an example of data pushed into the data layer every time a user sends a message using HubSpot Chat. In addition, data is pushed when chats start, agents respond, and unknown users enter their email addresses.

All data layer values can be captured inside marketing platforms or as variables using Google Tag Manager. In addition, triggers can be used for conversion tracking, and you can even generate custom data layer values based on other activity and user characteristics.

chatAutomaticValues: {
    messageFromUserCount: '3',
    hsChatType: 'Hubspot Form chat Message from User',
    hsChatLocation: {
      href: '',
      host: '',
      hostname: '',
      pathname: '/',
      protocol: 'https:',
      originPathName: ''

Custom Data Layer Values

Using data from your chats, website, and user activity, ListenLayer allows you to write bulk rules that generate powerful, custom data layer values. With this feature, data collection and marketing analytics becomes nearly limitless!

Some examples of popular custom data layer values for HubSpot Chat:

  • Trigger conversions only when users send four or more messages
  • Filter out test chats based on “test” email addresses entered
  • Capture and categorize chats based on website pages and sections

Once you realize the power of customization with Listeners, you’ll never go back to old-school conversion tracking!

chatCustomValues: {
    conversionCategory: 'Chat',
    leadQuality: 'High',
    system: 'Hubspot Chat',
    websiteSection: 'solutions'

Rate Chat Quality Based on Length

ListenLayer captures chat message counts from both the agent and the user. Write custom rules to label chat activity and segment by quality inside Google Analytics, Facebook Ads, Google Ads, or other platforms. Build this tracking framework once and watch it scale!

chatAutomaticValues: {
    messageFromUserCount: '4',
chatCustomValues: {
    chatQuality: 'High',