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

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-ALL-page-views/td-p/317047 - 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: How to Track Conversions for HubSpot Meetings – FINALLY! [FREE Code Snippets] - Speedwork and Here is how to track Hubspot chat conversation start: https://community.hubspot.com/t5/Reporting-Analytics/Hubspot-Chat-Tool-Recording-Conversions-in-Analytics-Adwords/td-p/208640 - 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

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 accounts will appear. Select the account(s) you want to connect to HubSpot, then click Connect.

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-report-builder-Pro/m-p/395723

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.

So we helped ourselves :slightly_smiling_face: 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).

i believe that for offline conversion, you could automatically push custom lists into your CRM from your offline channels. have you tried this already?

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.

Thanks for sharing, @Danielle1!

Hey Dan Y

ou’re tackling some complex tracking scenarios here. Let me address your questions:

1. **Multiple Google Ads accounts**: The native HubSpot integration does have limitations with multiple accounts. You could use tools like Attributer.io to capture the GCLID from all your Google Ads accounts and write it into hidden fields on your forms. Then it flows into HubSpot through your existing form integrations regardless of which Google Ads account the click came from.

2. **GA Client ID tracking**: That thread you linked is quite old and the approach is pretty technical. WHat is it that you are actually trying to achieve? As a few of the commenters said, you can write some Javascript to call HubSpot’s Identify call and the data will be stored in HubSpot’s cookie. Then when the person identifies themself (by filling out a form, booking a meeting, etc) the informaiton stored in the cookie (including the GA CLient ID) would be captured as part of the Contact Record. That being said, I’m not really sure what the point of this is. If it’s just getting attribution data on each contact/lead, there are far easier ways to do it.

3. **Meeting bookings via chat**: As for sending events back to Google Ads and Google Analytics when someone starts a chat or books a meeting, there are tools like converly.io which can do this for you. It’s basically like HubSpot Workflows but for conversion tracking (you pick a trigger, like when a HubSpot chat is started, and then pick your actions, like sending a conversion to Google Analytics or Google Ads).

Hope this helps!

Aaron

Quick note: I used an AI assistant to help structure this response because I’m not a great writer, but the recommendations are based on my experience and I’ve reviewed everything before posting.