5

I've created a Google Analytics Content Experiment in GA, copied the code, added it to my site's Google Tag Manager container, set it to trigger @

https://www.example.com
https://www.example.com/
https://www.example.com/h2/
https://www.example.com/h3/

However, every time I load https://www.example.com in any browser, I stay there and am not redirected to a variant.

GA says the experiment code is detected at /h2/ & /h3/ but not /.

The Tag Manager code is installed in the same Wordpress theme that all of the above pages use.

Help appreciated.

Insight
  • 202
  • 3
  • 28

1 Answers1

0

Not sure if you know but Content Experiment is now Google Optimize.

To debug this here is what I would do:

  • Make sure you follow the official GTM instructions which include setting up tag sequencing
  • Enable the GTM preview
  • If the Optimize tag doesn't trigger, GTM should tell you why (what trigger is failing, or what blocking trigger is being applied)
  • If the Optimize tag triggers BUT experiments don't, I would clear browser cache to remove earlier Optimize persistence and make sure the experiment rules match the page conditions (eg URLs)
  • Another reason might be Optimize timeout whereby Optimize snippets take too long to load

.async-hide { opacity: 0 !important} (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; })(window,document.documentElement,'async-hide','dataLayer',4000, {'GTM-XXXXXX':true});

Max
  • 12,794
  • 30
  • 90
  • 142