Using GTM to Pass Your UTMs Into Your CRM — A Complete Recipe With Plain JavaScript
Published · Tags: GTM, Google Analytics 4, UTM Parameters, Campaign Attribution, CRM, Salesforce, HubSpot, sessionStorage, Cookies, JavaScript Getting UTM parameters from a campaign link on the open web into a CRM like Salesforce or HubSpot is one of the most recurring questions in web analytics. The UTM only exists on the landing page URL — but the form that captures the lead is often several pages, and several minutes, later in the visit. This recipe walks through every hop the UTM has to make to survive that journey. Credit where it's due: the seed for what follows is "Transfer UTM Parameters From One Page To Another with GTM" by Julius Fedorovicius of Analytics Mania. Read that article first for the deeper background — this post adapts and extends that pattern across the several places a UTM needs to travel before it lands as a field value in your CRM. The Core Problem: A UTM Only Exists on One URL A UTM parameter is appended to a single landing URL by whoev...