Optimize
1.7K members online now
1.7K members online now
Everything you need to know about setting up Optimize including creating your account and container, linking to Google Analytics and how to tag your site.
Guide Me
star_border
Reply

Running Google Optimize when deploying Analytics with Tag Manager results in an error

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

I followed Google's article How to use Optimize when you deploy Google Analytics with Google Tag Manager, but I keep getting an error on Google Optimize:

Something seems wrong. Your experiment is running but hasn't received visits.

I used the Analytics debugger and everything seems fine, so I'm asking for your help.
Here's my setup:

<meta charset="utf-8">
<script>dataLayer = [...]</script>

//Page hiding snippet
<style>.async-hide {
  opacity: 0 !important
} </style>
<script>(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-XXXXXXX': true});</script> //Optimize container id

//Requiring optimize in the analytics code, but not calling a pageview
<script>
  (function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r;
    i[r] = i[r] || function () {
        (i[r].q = i[r].q || []).push(arguments)
      }, i[r].l = 1 * new Date();
    a = s.createElement(o),
      m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src=g;
    m.parentNode.insertBefore(a, m)
  })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
  ga('create', 'UA-YYYYYYYYY-YY', 'auto', {name: 'rollup', cookieName: '_rollupGa', allowLinker: true}); //Rollup analytics tracking id
  ga('rollup.require', 'GTM-XXXXXXX'); //Optimize container id
</script>

//Tag manager snippet
<script>
  (function (w, d, s, l, i) {
    w[l] = w[l] || [];
    w[l].push({
      'gtm.start': new Date().getTime(), event: 'gtm.js'
    });
    var f = d.getElementsByTagName(s)[0],
      j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
    j.async = true;
    j.src='https://www.googletagmanager.com/gtm.js?id=' + i + dl;
    f.parentNode.insertBefore(j, f);
  })(window, document, 'script', 'dataLayer', 'GTM-ZZZZZZ'); //Tag manager id
</script>

And here are my settings in Google Tag Manager:

Any help will be highly appreciated, thanks for reading.

Running Google Optimize when deploying Analytics with Tag Manager results in an error

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

Hi, you should use this implementation: https://support.google.com/360suite/optimize/answer/6262084?hl=en 

 

Running Google Optimize when deploying Analytics with Tag Manager results in an error

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

Thanks, but this article is not for setups with Google Tag Manager.

Also, except sending the pageview it's exactly the same as my code.

Running Google Optimize when deploying Analytics with Tag Manager results in an error

[ Edited ]
Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆

Update:

 

A/B tests are working fine.

Redirect tests are running but not reporting back.

Running Google Optimize when deploying Analytics with Tag Manager results in an error

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Has your problem solved? 

 

I'm testing on staging now and looks like I have the same issue. Just to results feed into report. But when I test in different browsers myself, I can see different variant.

 

Any new updates?

Thanks,

Running Google Optimize when deploying Analytics with Tag Manager results in an error

Follower ✭ ☆ ☆
# 6
Follower ✭ ☆ ☆

I'm afraid no updates on the issue.

 

There are also others who face the same issue:

https://www.en.advertisercommunity.com/t5/Google-Optimize-Reporting/No-results-for-redirect-test/m-p...

 

It's a shame no one from Google had replied yet.

Running Google Optimize when deploying Analytics with Tag Manager results in an error

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi, someone solved the issue?

I have the same problem in 2 of my experiment, but not on other experiments...

Would love to hear how you solved it.

 

Thanks