I'm looking into a solution to track the Gclid parameter (and potentially other UTM parameters) via the cookie and hidden field in Hubspot.
I've found the following post on GitHub that describes a good solution: https://gist.github.com/jakebellacera/54d30aa662b706aecf633664b96c60a6
It suggests implementing this code on every page AFTER the HubSpot tracking code.
I have two questions here:
- We've implemented the HubSpot tracking code via GTM and therefore don't have the HS tracking code in our CMS directly. It's therefore unclear to me where we should install the Gclid tracking code. Can we still install it like it is (into our CMS or GTM?) or do I first need to replace the GTM tag by installing the initial HS tracking code on all pages and then paste this code after HS tracking code?
- Would I be able to expand this code in order to track other UTM parameters via the cookie, are there examples of code that I can install?
*** Important note, I'm not a developer and don't have much coding skills **