Reporting & Analytics

Danylo
Member

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

Hi. I'm not a complete newbee to Google Ads GA & GTM, but I am new to Hubspot. So I've just digged into the subject above and structured my inquiry for you hopefully to advice more:

1. Track Google Ads Glcid - it goes with native Hubspot integration. Any alternatives to track more than two Google Ads accounts per one Hubspot account?

2. This looks like a solution to track GA CID as well but it's not a finished one, just the idea: https://community.hubspot.com/t5/APIs-Integrations/Get-Google-Analytics-Client-ID-into-Hubspot-for-A... - Anybody saw the ready DYI guide or detailed algorythm?
3. Here is also how to track HubSpot meeting conversions in GA and PPC with the help of GTM: https://speedworksocial.com/hubspot-meetings-conversion-tracking/  and Here is how to track Hubspot chat conversation start: https://community.hubspot.com/t5/Reporting-Analytics/Hubspot-Chat-Tool-Recording-Conversions-in-Anal... - Based on this two ar nother solutions: does anybody know how to track the same Hubspot meeting conversions, when booking is done via Hubspot chat?

Look forward to creating a really usefull artcile together!

Regards,

Dan

0 Upvotes
2 Accepted solutions
Danylo
Solution
Member

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

So we helped ourselves 🙂 If it's about to track offline sales and/or offline conversions in GA, the CID field is by far not a single one you need to track to bypass GA filter as well as to send a proper GEO of a user, not a server. We use our own developement - GTM tag to track all the needed dats and inject them as a hidden Non HubSpot form fields, that can still be tracked by HubSpot. The rest is done by a connector (Zapier dosn't do this preperly).

View solution in original post

0 Upvotes
Danielle1
Solution
Participant

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

I figured out how to store and capture the GCLID using the code below in Tagmanager for contacts in Hubspot. However, I still need code to do the same thing for the MSCLKID (Microsoft Click ID for Microsoft Ads). If you know how to fix this problem, please paste the code for tagmanager in the reply.

 

If you need help with store the GCLID, paste the code below into tagmanager using all pages as the trigger.

 

<script>


function getParam(p) {
var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

function getExpiryRecord(value) {
var expiryPeriod = 90 * 24 * 60 * 60 * 1000; // 90 day expiry in milliseconds

var expiryDate = new Date().getTime() + expiryPeriod;
return {
value: value,
expiryDate: expiryDate
};
}

function addGclid() {
var gclidParam = getParam('gclid');
var gclidFormFields = ['gclid_field', 'foobar']; // all possible gclid form field ids here
var gclidRecord = null;
var currGclidFormField;

var gclsrcParam = getParam('gclsrc');
var isGclsrcValid = !gclsrcParam || gclsrcParam.indexOf('aw') !== -1;

gclidFormFields.forEach(function (field) {
if (document.getElementById(field)) {
currGclidFormField = document.getElementById(field);
}
});

if (gclidParam && isGclsrcValid) {
gclidRecord = getExpiryRecord(gclidParam);
localStorage.setItem('gclid', JSON.stringify(gclidRecord));
}

var gclid = gclidRecord || JSON.parse(localStorage.getItem('gclid'));
var isGclidValid = gclid && new Date().getTime() < gclid.expiryDate;

if (currGclidFormField && isGclidValid) {
currGclidFormField.value = gclid.value;
}
}

window.addEventListener('load', addGclid);

</script>

 

You will also have to create a property in Hubspot called gclid and change it to hidden on your forms. 

View solution in original post

4 Replies 4
Danielle1
Solution
Participant

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

I figured out how to store and capture the GCLID using the code below in Tagmanager for contacts in Hubspot. However, I still need code to do the same thing for the MSCLKID (Microsoft Click ID for Microsoft Ads). If you know how to fix this problem, please paste the code for tagmanager in the reply.

 

If you need help with store the GCLID, paste the code below into tagmanager using all pages as the trigger.

 

<script>


function getParam(p) {
var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

function getExpiryRecord(value) {
var expiryPeriod = 90 * 24 * 60 * 60 * 1000; // 90 day expiry in milliseconds

var expiryDate = new Date().getTime() + expiryPeriod;
return {
value: value,
expiryDate: expiryDate
};
}

function addGclid() {
var gclidParam = getParam('gclid');
var gclidFormFields = ['gclid_field', 'foobar']; // all possible gclid form field ids here
var gclidRecord = null;
var currGclidFormField;

var gclsrcParam = getParam('gclsrc');
var isGclsrcValid = !gclsrcParam || gclsrcParam.indexOf('aw') !== -1;

gclidFormFields.forEach(function (field) {
if (document.getElementById(field)) {
currGclidFormField = document.getElementById(field);
}
});

if (gclidParam && isGclsrcValid) {
gclidRecord = getExpiryRecord(gclidParam);
localStorage.setItem('gclid', JSON.stringify(gclidRecord));
}

var gclid = gclidRecord || JSON.parse(localStorage.getItem('gclid'));
var isGclidValid = gclid && new Date().getTime() < gclid.expiryDate;

if (currGclidFormField && isGclidValid) {
currGclidFormField.value = gclid.value;
}
}

window.addEventListener('load', addGclid);

</script>

 

You will also have to create a property in Hubspot called gclid and change it to hidden on your forms. 

kvlschaefer
Community Manager
Community Manager

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

Thanks for sharing, @Danielle1


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
Danylo
Solution
Member

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

So we helped ourselves 🙂 If it's about to track offline sales and/or offline conversions in GA, the CID field is by far not a single one you need to track to bypass GA filter as well as to send a proper GEO of a user, not a server. We use our own developement - GTM tag to track all the needed dats and inject them as a hidden Non HubSpot form fields, that can still be tracked by HubSpot. The rest is done by a connector (Zapier dosn't do this preperly).

0 Upvotes
webdew
Guide | Diamond Partner
Guide | Diamond Partner

How to track everything: Google Ads Gclid and Google Analytics CID for HuSpot Meeting via Chat etc.

SOLVE

Hi @Danylo ,

1- For this question, are you asking if it is possible to connect more than one google ads account in hubspot?

 

If this is so, then the answer is yes. this is mentioned in the KB doc here:

 

In the dialog box, select Google Ads. If you have multiple Google Ads accounts, a list of your accou...



2- Based on the discussion so far, there are some suggestions on the functions they can use to track the user's page views, there is no article or guide on this so far, you might want to check out if the other community thread linked by Isaac is relevant to what you want to do here.

 

3-If I am not wrong then you want to track the conversions on meeting links, based on the conversations done in your live chats? If so, then 

 

you could create a report to show the sales activities and contacts, then filter the sales activities by "meetings" and show the "meeting source"

 

It could possibly show you different meeting source based on where the contact got the meeting link from

https://community.hubspot.com/t5/Reporting-Analytics/Report-on-meeting-links-using-the-beta-custom-r...

 

You can try this method here^ suggested by one of the technicians. 

 

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.