• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Error message

darelas

New member
Messages
3
Likes
0
Points
1
#1
I'm trying to create Google Tag Manager snippets. Unfortunately, after creating this I can see message on top of the page:
class="home page-template-default page page-id-283 logged-in admin-bar no-customize-support wp-custom-logo right-sidebar">
 

Temyk

Developer & Support
Staff member
Messages
704
Likes
32
Points
28
#2
Hello.

So something is wrong with your snippet. Check it again.
 

darelas

New member
Messages
3
Likes
0
Points
1
#3
this is standart google snippet:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Google tells that it should be inserted "immediately after the opening <body> tag on every page of your website, replacing GTM-XXXX with your container ID"

So my option on Woody is "automatic insertion" and "insert before post". This is wrong?
 

Temyk

Developer & Support
Staff member
Messages
704
Likes
32
Points
28
#4
The snippet code that you sent initially will not work. The problem is probably something else. Do you have other snippets? Try turning them off one at a time and checking
 

darelas

New member
Messages
3
Likes
0
Points
1
#5
Yes, there are two snippets, one in head, one in body:

"To implement Google Tag Manager on your website:

Copy the following JavaScript and paste it as close to the opening <head> tag as possible on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager -->
<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-XXXX');</script>
<!-- End Google Tag Manager -->


Copy the following snippet and paste it immediately after the opening <body> tag on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->"


The first snipped I've inserted to location "head" to "entire website". Error message was after the second snippet. Now I've changed the location option of the second snippet from "insert before post" to "insert before content" and everythings seems OK now, without error messages. But if you say that this code initially will not work, now I don't know if it works to Google...
 

Temyk

Developer & Support
Staff member
Messages
704
Likes
32
Points
28
#6
I thought you were using a once fragment