Reporting & Analytics

GAnoh
Member

Tracking offline conversions with Zapier and Hubspot

SOLVE

Hi, I am would like to send 'offline conversions back to google ads through Zapier' and I am facing an issue within Zapier with finding the gclid to attach to a deal. My understanding is that the gclid is not attached to the deal in hubspot, and I would like to know how to solve this issue. Do I need to create an automation within Hubspot? I am really not sure and would like to know what the best way is, is to achieve this

0 Upvotes
2 Accepted solutions
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

Tracking offline conversions with Zapier and Hubspot

SOLVE

Hey @GAnoh , 

 

thank you for reaching out to the community. If I understand you correctly, there is actually no need for Zapier. You can sync Conversion Events back to Google by using the Lifecycle Stage. It is fully described in this help article here:

https://knowledge.hubspot.com/ads/create-and-sync-crm-lifecycle-events-with-your-google-ads-or-faceb...

 

Depending on what signals you want to track as an conversion event to Google, you might want to create an automation/workflow to set a certain Lifecycle Stage. I've made a slide explaining that concept in the past to illustrate:

 

B2995E68-2404-4614-B11C-5D3223AE2391.jpeg

 

In this case an SQL is set by a workflow and then it triggers the conversion event to one of your networks. 

 

Does that help you case or am I missing some important information here?

 

Cheers, 

Chriso

View solution in original post

Danielle1
Solution
Participant

Tracking offline conversions with Zapier and Hubspot

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 storing 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, add it to your forms, and change it to hidden on your forms. 

View solution in original post

6 Replies 6
Danielle1
Solution
Participant

Tracking offline conversions with Zapier and Hubspot

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 storing 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, add it to your forms, and change it to hidden on your forms. 

DianaGomez
Community Manager
Community Manager

Tracking offline conversions with Zapier and Hubspot

SOLVE

Thanks for sharing, @Danielle1 😉


¿Sabías que la Comunidad está disponible en Español?
¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuraciones!

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


0 Upvotes
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

Tracking offline conversions with Zapier and Hubspot

SOLVE

Hey @GAnoh , 

 

thank you for reaching out to the community. If I understand you correctly, there is actually no need for Zapier. You can sync Conversion Events back to Google by using the Lifecycle Stage. It is fully described in this help article here:

https://knowledge.hubspot.com/ads/create-and-sync-crm-lifecycle-events-with-your-google-ads-or-faceb...

 

Depending on what signals you want to track as an conversion event to Google, you might want to create an automation/workflow to set a certain Lifecycle Stage. I've made a slide explaining that concept in the past to illustrate:

 

B2995E68-2404-4614-B11C-5D3223AE2391.jpeg

 

In this case an SQL is set by a workflow and then it triggers the conversion event to one of your networks. 

 

Does that help you case or am I missing some important information here?

 

Cheers, 

Chriso

bhicks1
Member

Tracking offline conversions with Zapier and Hubspot

SOLVE

I have the same question as the poster. I'm aware of Hubspot Google Ads conversion events. The issue is setting the value for the conversion events. I'd like to push the value from a field or a variable, but that isn't an option in the event settings. You can either manually set the value, or you can use the deal value. To get around this, I'm trying to use Zapier to pass the value from the field I want to use (which automatically calculates it), but I have the same problem — hs_google_click_id is a contact object, not a deal object. I created a deal object called GCLID but can't figure out how to copy the value from the contact object to the deal object using a workflow.

0 Upvotes
bhicks1
Member

Tracking offline conversions with Zapier and Hubspot

SOLVE

Actually, figured it out. Create a deal object called GCLID (or whatever makes sense) and then you can create a workflow to 1) check that there is a value in hs_google_click_id, and then 2) copies the value from that property to your new custom deal property. hubspot gclid to deal property.png

0 Upvotes
GAnoh
Member

Tracking offline conversions with Zapier and Hubspot

SOLVE

Hello Chriso,

 

thanks for your reply.

 

From what I understand, I need to create events for this in HS, and my package does not allow mw to do that. So this is why I am going through Zapier.

 

Best

0 Upvotes