Can I track HubSpot Chat conversions in compliance with GDPR?

by Meike Müller

How can you successfully track HubSpot Chat conversions to Google or Matomo while remaining GDPR compliant? The following JavaScript snippet addresses this issue. The problem is that when using CookieMangers, the HubSpot Chat is only reloaded after accepting the CookieConsent. So we have to find a way to check for consent after loading the chat and then register for the conversationStarted event.

Reading time 2 min

//functions handles the tracking calls, when the hubspot chat widget is ready
function onConversationsAPIReady() {
console.log('hubspot chat now running'); 
//add listener for a started conversation
window.HubSpotConversations.on('conversationStarted', payload => {
//track here
ga('send', 'event', 'Beacon', 'chat-started', 'Hubspot'); });
//add listener for accepting the cookies
window.addEventListener('CookiebotOnAccept', function (e) {
//maybe check if marketing cookies are allowed
if ({
console.log('accept marketing cookies');  
//now check for hubspot chat widget status
if (window.HubSpotConversations) {
console.log('hubspot chat already running'); 
} else {
console.log('hubspot chat awaiting'); 
window.hsConversationsOnReady = [onConversationsAPIReady];
}, false);

What is Google Analytics anyway?

Google Analytics is a free analysis tool from the company Google. Website operators or app owners can monitor the performance of their online presence and identify potential for improvement. Data such as page views, bounce rates and dwell time are recorded and displayed in statistics and reports. By using Google Analytics, website owners can find out whether their pages are working well and which areas still need to be optimized.

FAQ: Questions and answers about HubSpot

If you still have questions about HubSpot, you can find a few frequently asked questions and the corresponding answers and explanations here. Do you still have a specific question or need help with HubSpot? Then don't hesitate to contact us. We are here to help and advise you with your digital projects.

  • What does a cookie manager do?

    You can use a cookie manager to control cookies and edit them so that cookies are allowed or blocked on certain websites. This can always be checked and changed in the Cookie Manager. A cookie manager makes sense for you if, among other things, you want to automate tasks using a time-saving technology.

  • What is a cookiebot anyway?

    A cookiebot is a cloud service that works automatically and in compliance with global data protection laws such as the GDPR. With the special deep-scanning technology, all trackers and cookies on the website can be recognized and controlled. The Cookiebot is for you if you want to be 100% data protection compliant.

  • What is a cookie banner?

    A cookie banner must be obtained for consent from website visitors, as third-party providers are integrated on the website and carry out user behavior, etc. there. Website creators must provide visitors with a cookie banner in order to remain compliant with the global data protection laws of the GDPR.

  • What does the GDPR mean?

    The GDPR was introduced on May 25, 2018 and applies to all companies that process the personal data of EU citizens, regardless of where the company is based. The regulation establishes a high level of data protection for all personal data and sets stricter requirements for the processing of personal data.

    The regulation requires companies to make their privacy policies clear and understandable to users. Companies must also ensure that user data is only processed for the stated purpose and that they take appropriate measures to protect the data.

    In addition to the GDPR, there are standard contractual clauses developed by the European Commission to facilitate the cross-border transfer of personal data. These clauses are used by companies to ensure that data protection requirements are met when personal data is transferred from one country to another.

    Companies must also ensure that they take appropriate technical and organizational measures to protect personal data, including compliance with data protection policies and the implementation of appropriate security measures. If a company violates the GDPR, it can be fined heavily.

  • What is a data protection authority and what are its tasks?

    A data protection authority is an institution that is responsible for monitoring and enforcing data protection laws. Each country has its own data protection authority, which is responsible for ensuring compliance with data protection laws within the country. In the European Union, there is also the European Data Protection Authority, which is responsible for coordinating the data protection authorities in the EU member states.

    The main tasks of a data protection authority include monitoring and enforcing data protection laws, advising and assisting companies and citizens on data protection issues, investigating data protection breaches, imposing fines and penalties on companies that have violated data protection laws, and cooperating with other data protection authorities at national and international level.

    The specific tasks of a data protection authority include reviewing privacy statements and the data protection practices of companies, monitoring data processing operations, authorizing data transfers to third countries, investigating data breaches and advising companies and citizens on data protection issues

  • What specific features of HubSpot Chat could pose potential privacy issues?

    HubSpot Chat uses cookies to track user interactions, which could raise concerns in the context of the GDPR, as explicit user consent is required for the setting of such cookies. In addition, the storage and processing of personal data collected during chats without appropriate security measures and consent procedures could violate the GDPR. Therefore, it is crucial that companies using HubSpot Chat ensure that they correctly implement privacy policies and practices and obtain explicit consent from users.

What is your project? If you want to tell us about it, we'll call you back!

from 06.04.2022

Hello, my name is Meike. I take care of the EXWE back office and am responsible for our social media channels. All of our articles are meant to make your life easier and help you make decisions. Nevertheless, it can happen that something remains unclear, so: If you have questions about this article you can easily reach me at +49 231 93149827.

You always want to stay at the cutting edge of technology Don't miss any more news and blog posts.
We also have the following interesting posts from our tech blog for you on this topic
What is a web app? What you need to know about web applications

What is a web app? Optimize your business and use the advantages of an individual web app for your company.

What is frontend & backend programming?

Programming and web development consists of frontend, middleware and backend development. You can find an overview in our blog article.

Developing your own CMS: Step by step to a customized content management system

Discover the art of developing your own CMS! Learn step by step how to design and optimize your individual content management system. Start now and realize your web visions with ease