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

Google Optimize via GTM - No HTTP response detected

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I have an issue. When I'm trying to deploy the Google Optimize tag I see a notification In google tag assistant: No HTTP response detected. I use Google Tag Manager with a custom HTML.

Can anyone help, attached is a screen how my code looks like.

 

I even deleted the 1st part of Page Hiding Snippet, but without success.

 

PS. in addition, if I keep the last tag live ga('send', 'pageview'); - no errors. What's wrong with code?

Screenshot_4.jpg

Screenshot_5.png

 

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author Виталий П
April

Google Optimize via GTM - No HTTP response detected

Google Employee
# 2
Google Employee

I think that you are probably confused with the message of the snippet installation dialog.

 

Look for more at: https://support.google.com/360suite/optimize/answer/6262084?hl=en

 

I don't think that you should delete the

 

ga('send', 'pageview'); 

 

line, since this has to exist somewhere to send data to google analytics.

 

I think that the message in the dialog tries to explain that people shouldn't have this line twice, since they will be sending double data to google analytics.

 

Apart from there is also a problem in your code with the page hiding snippet:

 

 

First of all this cpde can't be added inside the Google Tag Manager since its purpose is to avoid flicker until the GTM or Optimize scripts load. So the only option for this is to add it inline in the page.

 

Furthermore, if you are trying to load Optimize via GTM, you may want to consider the GTM Optimize tag.

 

If this is not an option, then the best approach is to use the GTM container ID in the inline page hiding snippet (so that the page will be hidden until the GTM script loads) and then add the following line inside your custom HTML code:

 

dataLayer.hide['GTM-<Optimize container id>'] = true;

 

which will ensure that the page will remain hidden until the Optimize container also loads (otherwise the page will be shown just after the GTM script loads and you may still have flicker).

 

Unless you are not worried much about flicker, in which case you may not use the page hiding snippet at all.

 

See for more:

 

https://support.google.com/360suite/optimize/answer/6262084?hl=en

https://developers.google.com/optimize/