We are experiencing loss of functionality related to campaign tracking with Google Analytics (GA) using Google Tag Manager (GTM) in our Sitecore instance in all environments.


We can clearly see tags firing and real-time reporting, however campaigns do not pull through. Google AdSense shows user clicks and impressions which link back to the site, each in its correct environment. We have each of Development, Staging, and Production environments, each with their own GTM container, and the issue presents in all 3. Those clicks and impressions are configured to correspond to AdSense campaign parameters, but somewhere they are lost.


The GTM setup and its collection of tags have been reviewed by three independent digital marketing agencies for validity, and they have been found to be without issue by each review. Further, we validated the behavior by putting the same GA tag on a static non-Sitecore site to remove Sitecore from the equation. Both Sitecore and the test site are fronted with Cloudflare using the same configurations (DNS excepted). We could not reproduce the issue on the static  site -- all details pulled through as expected.


Are there any known issues with GTM or GA in a Sitecore XP1 k8s deployment environment that I have been unable to turn up from searching the Web? Are there any common catch-outs that we have managed to miss in setting this up?


This is not a new or intermittent issue; it has persisted over the course of the year-plus that we have had this Sitecore instance in production.


Technical details:

  • Sitecore 10.1-update 2
  • Deployed to Azure Kubernetes Service (AKS) using XP Scaled topology
  • Pulling images from scr.sitecore.com/sxp/sitecore-xp1-c[d|m]-10.1.2-ltsc2019
  • All instances fronted with Cloudflare

3 Answers 3


Thanks for the comments and suggested answers.

Turns out the problem -- as we suspected -- was in the GTM configuration. The tag being used to load Universal Analytics (UA) inside GTM had been set up with custom parameters that overwrote the page location and stripped all query string parameter from what was reported back to Google, thus removing the related utms from analytics.


It's difficult to say without seeing your website, but a couple of things that I would recommend to check are:

  1. Make sure there is no server-side redirect that removes UTM parameters from the URL. For example, it can be a trailing slash redirect, non-www to www redirect or http to https redirect that does not retain query string parameters.
  2. If you have a cookie banner on the website, check that it does not remove Google cookies in case the analytical/marketing category is disabled by default.

You can investigate when exactly UTM parameters or cookies are lost by opening the browser Dev Tools → Network tab, selecting the "Preserve log" option and then loading the AdSense URL in this browser tab. It will show all redirects and cookies added and removed by each request.

Generally speaking, Sitecore is not different from any other platform when using GTM & GA so there must be something wrong with redirects, cookies, GTM configuration or JavaScript on the website.


You could start by checking whether the campaign parameter and UTM parameter have been added correctly to the URL. To do this, you can review the URLs in your AdSense account to confirm that they contain the appropriate UTM parameters.

Another step you can take is to clear your cookies and try again. This can help to resolve any issues related to caching.

Additionally, you should check that the Google Analytics tag in Google Tag Manager has been set up correctly. Ensure that the tag is configured to fire on all pages and that the UTM parameters are being passed through correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.