Optimize
1.8K members online now
1.8K 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

Optimize Error during preview

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have added the GA Optimize JS snip-it to our existing GA setup right after the 'create' call...

 

ga('create', XXXXXXXX, 'auto');
ga('require', 'GTM-XXXXXXX');

 

I see my browser sending a request to GA with our Optimize ID

https://www.google-analytics.com/gtm/js?id=GTM-XXXXXXX&cid=XXXXXXX.XXXXXXX

 

When previewing I get this error message after page load:

"The Google Optimize snippet for the container with ID GTM-XXXXXXX is not correctly installed on this page. To preview variants for this experiment, make sure the Google Optimize snippet is installed on any pages you want to test."

 

Any help appreciated!

Optimize Error during preview

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Hi, any news on this? I have the exact same issue. I also see the alert with the same error message and the request made to GA with similar params as described by Casey S.

 

Thanks for the support.

Optimize Error during preview

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

It seems that Optimize is more particular about how the GA snipit is included.  We were loading GA via an external JS file... including the GA code inline, below our HTML body solved this issue.   Wish we didn't have to do this... but I'm sure it's critical for Optimize performance.... or to reduce original content flash.

Optimize Error during preview

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks for the tip! Unfortunately in our case the code is already inlined. Tried moving it around from <head> to <body> and below, but the issue persists. Also tried copy/pasting the very same examples Google provides (of course replacing ID and CID with real values) but we still get the error. What's weird is that even though we get an error message alert, once we close it the page actually does show the experiment running. 

Optimize Error during preview

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

I have the exact same issue. I also have GA script inline but our Optimize Script gives the error. Did you managed to solve this.

Re: Optimize Error during preview

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hi,

I have created an experiment in google optimize and added all the conditions.

 

Now, when I'm clicking on web preview. I'm getting below error:

 

The container has the following errors:

Type: Unknown variable name

Location: Unknown trigger

Description : Unknown variable 'prod_serv_comp' found in a trigger. Edit the trigger and remove the reference to the unknown variable.

 

I unable to locate this prod_serv_comp variable. I have even deleted my experiment and created a new one. but, still I'm getting this error.

Please help me resolve this.