Ads Offline Conversion Tracking: Get GCLID & FB Lead ID
Hi all,
when thinking about sending offline conversion data back to Google Ads and Facebook Ads from Hubspot (so MQL / SQL etc. values via events - great feature by the way!), I came accross this post:
In the bottom part it says that GCLID and FB Lead ID are send back to the ad tools. This, of course, implies that they are necessary within Hubspot, too.
Does someone know how Hubspot captures them? Is it done automatically or do I need to implement it manually in the form tracking (hidden form fields)?
Ads Offline Conversion Tracking: Get GCLID & FB Lead ID
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;
Ads Offline Conversion Tracking: Get GCLID & FB Lead ID
@jfrade what would be the best way to take advantage of hubspot lifecycle stage changes in Facebook if I'm not runing a Lead Ads campaign but rather a standard form submit conversion on a landing page. I'm asking because I noticed we don't sync any lifecycle stage events back with facebook, only with google, and it appears this is due to not running any lead ads campaigns (poor quaility for us). Would it be best to make an audience based around an MQL segmented contact list for example?
Ads Offline Conversion Tracking: Get GCLID & FB Lead ID
Hey @sb_1 ! Glad you're liking the offline conversions feature. For Google you will need to make sure auto tagging is turned off, which ensures that Google will automatically add the GCLID to the URL as well as having HS Ads auto tracking turned off. This way when contacts click and convert on your ad that will get stored on the contact record under the "google click id" property.
For Facebook, the offline conversions feature only works with lead ad conversions, so if you are running lead ads any time a new lead comes through it will automatically have a lead id on the contact record.
thanks very much - really helps und solves our issue! There would be one additional question 😉 Is it planned to also enable sending offline conversions to LinkedIn lead gen ads?