This tag stores data in both the page referrer and URL parameters within a browser cookie. This cookie proves useful, particularly on conversion pages or when user consent has been obtained, allowing the session to be correctly attributed to the relevant campaign.

Furthermore, this template offers a solution to the rogue referral issue. By enabling the “Store campaign data in a browser cookie” option, you can specify the URL parameters that trigger a cookie write. If any of these parameters are present in the page URL when the tag is activated, the page URL is recorded in the browser cookie.

persist campaign data

In scenarios where the page referrer hostname does not match the current page hostname (indicating the user’s arrival from another domain), the referrer is also stored in a cookie.

Opting for the “Push original location in dataLayer” feature results in the tag pushing the current URL into the dataLayer. This can be leveraged to address the rogue referral problem effectively.

Persist Campaign Data

For single-page sites or apps, which typically involve content loading without refreshing the page, there is a specific challenge in Google Analytics tracking when configured through Google Tag Manager. The issue arises because, with every hit using a unique tracker object, the Document Location field is updated, causing problems in attributing sessions correctly.

To resolve this, the tag template offers a comprehensive solution, ensuring proper session attribution even on single-page sites. Explore the Google Tag Manager Template Gallery at https://tagmanager.google.com/gallery/ for easy access to this template and others.

Related Posts
Who is Salesforce?
Salesforce

Who is Salesforce? Here is their story in their own words. From our inception, we've proudly embraced the identity of Read more

Salesforce Marketing Cloud Transactional Emails
Salesforce Marketing Cloud

Salesforce Marketing Cloud Transactional Emails are immediate, automated, non-promotional messages crucial to business operations and customer satisfaction, such as order Read more

Salesforce Unites Einstein Analytics with Financial CRM
Financial Services Sector

Salesforce has unveiled a comprehensive analytics solution tailored for wealth managers, home office professionals, and retail bankers, merging its Financial Read more

AI-Driven Propensity Scores
AI-driven propensity scores

AI plays a crucial role in propensity score estimation as it can discern underlying patterns between treatments and confounding variables Read more