Sep 24, 20181:02 PM - edited Sep 26, 20188:55 AM
Participant | Gold Partner
Hubspot Chat Tool: Recording Conversions in Analytics/Adwords
SOLVE
Does anyone have any solutions/suggestions for recording live chat conversions in Analytics/Adwords? Can I record contacts created from live chat in Analytics and then create a goal that could translate to a conversion in Adwords?
We are using the Hubspot chat tool.
We would like to use chat on our ppc landing pages, but because we cannot record chats and conversions, we have not yet set them up.
However, there isn't a way to track when a user provides their email address - which is really when you would truely count a conversation as a "lead" for analytical purposes. So this above script would track the following (assuming you use Google Tag Manager):
Users who open/close the chat window
Users who close the chat welcome message (if you're using one)
I will say it is best practice to push an event to something like GTMs dataLayer rather than explicitly pushing to a platform in the event listener itself. That keeps your tracking tags visible inside GTM and auditable/testable using its debug and preview tools.
I just wanted to add to this that HubSpot have now introduced a `contactAssociated` event.
I have just implemented a usage for this to push an AdWords conversion event when triggered by our Chat Flow setup which asked for name and email, thus creating/associating a contact from the chat user. We are considering this as conversion rather than just starting a chat conversation.
An approximation of what I implemented:
function onConversationsAPIReady() {
window.HubSpotConversations.on('conversationStarted', function(payload){
//console.log("HubSpot Conversation Started");
// Do something here to track if necessary
});
window.HubSpotConversations.on('contactAssociated', function(payload){
//console.log("HubSpot Contact Associated");
// Do whatever you like here to track
if(typeof window.gtag === 'function'){
//Event snippet for Chat Contact Associated conversion page
window.gtag('event', 'conversion', {'send_to': 'YOUR/CONVERSION/ID/HERE'});
}
});
}
Jul 31, 20191:15 AM - edited Jul 31, 20191:16 AM
Participant
Hubspot Chat Tool: Recording Conversions in Analytics/Adwords
SOLVE
Hello, I have met your post and we have managed to send sales to Google Ads, Analytics and send click and lead event with the HubSpot chat.
I am not a technician but it still helps you with your development team.
1. We collect variables such as clientid and gclid in each user's session cookie (client with Google Analytics and Google Ads, and gclid to attribute sales to campaigns in Ads).
2. You must save this information as a contact property in HubSpot. And save it as a hidden field in a form.
3. With this information you can generate a Webhook that you can send to the different platforms by API in Google Ads (complicated by Google documentation) and Measurement protocol by Google Analytics (I do not know if there is another way but surely this is the easiest ). In this way you can send the information in a workflow and webhook when there is a sale, lead or any action (for example).
4. For the chat, we have recently been able to send all user information. To do this you must activate the possibility of creating contacts in HubSpot without the need for email. Then after a chat action event (click or conversation), send the information via the HubSpot API and create a form with the user token to associate the Chat conversation and the information collected with the contact. (look this post) Then in the logic of the chat you can send a webhook to Google Analytics or Google Ads to send the event.
In short, this is what we have implemented to be able to collect and send events with the integral and measured funnel.
Your post and requirement has time, but I hope it helps you or someone else.
Hubspot Chat Tool: Recording Conversions in Analytics/Adwords
SOLVE
@znicholson both will likely work. Probably best to use the public API though. Do you have specific questions about how to use it? HubSpot writes their JavaScript docs using ES6 syntax which isn't natively supported in all browsers and it can look a little odd. See below for a more supported JS syntax:
<script> window.HubSpotConversations.on('conversationStarted', function(payload){
dataLayer.push({'event': 'hs_chat_started'}); // This will need customized to your particular needs.
}); </script>
I recently looked into this for our agency as well.
Unfortunately, I wasn't able to track when a visitor actually sent a message. What I was able to do was implement interaction tracking on the chat window itself using the following code (note that this has some customizations for our Google Tag Manager setup).
That will push a dataLayer event for opened/closed click interaction, which isn't perfect, but it's a start.
HubSpot needs to implement a window message event for "message sent" so we can truely know when a chat has been started (not just assuming a click = a conversation).
However, there isn't a way to track when a user provides their email address - which is really when you would truely count a conversation as a "lead" for analytical purposes. So this above script would track the following (assuming you use Google Tag Manager):
Users who open/close the chat window
Users who close the chat welcome message (if you're using one)
Hubspot Chat Tool: Recording Conversions in Analytics/Adwords
SOLVE
I entered your code and not seeing data come through in GA, any tips? Also, I need to push multiple converion pixels though this code, what is the best way to do this? Copy and paste the code multiple times, our append the code at the end to fire all the pixels I need fired?
Feb 11, 20204:40 PM - edited Feb 12, 202010:07 AM
Contributor | Platinum Partner
Hubspot Chat Tool: Recording Conversions in Analytics/Adwords
SOLVE
Update: Apparently the trigger isn't very clear and could be due to newer ways to set up listeners for chat events.
I am trying to reconcile the data here. 27 total events with 7 Unique events this week (Monday and Tuesday).
When looking at the Conversations Inbox within the HS portal, I see 6 chat sessions.
My question is, what constitutes that a conversation started? If someone clicks one of the screening questions from the bot but doesn't finish with the form (provide email) is that a Conversation Started event? Does that mean if there are 7 unique events and only 6 chat sessions, that one person never actually connected with an agent?