Using GTM to Decorate Link URLs for Improved Campaign Measurement
Published · Tags: GTM, Google Analytics 4, UTM Parameters, Iframe CRM, Pardot, HubSpot, Cookies, Cross-Domain Measurement, Client ID An iframe-embedded CRM form — the kind Pardot and HubSpot both commonly use — is treated by the browser as a completely separate document from the page that hosts it. That separation breaks campaign attribution the moment a visitor's UTM values and anonymous client ID need to follow them from the parent page into the form. This recipe decorates the iframe's own internal links with that information so the CRM can "see" it. This builds directly on an earlier post, "Write URL query strings 2 cookies," which persists incoming campaign values to first-party cookies. As with the UTM-to-CRM recipe, the underlying inspiration traces back to Julius Fedorovicius' "Transfer UTM Parameters From One Page To Another with GTM." This particular example targets a Pardot or HubSpot iframe lead-generation form specifically. ...