# Google tag manager visible on website

**URL:** <https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275>\
**Category:** RapidWeaver Classic\
**Created:** [April 12, 2019, 9:33pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275 "2019-04-12T21:33:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 9:33pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/1 "2019-04-12T21:33:32Z")

</div>

Hi, Im working on RW Version 8.1.7 with Lunar theme. I was instructed by my Ad manager to insert Google tag manager in the head of each page but I can see the Google tag manage code on a grey box at the top of my page. Any suggestions how to hide this please? My website is [https://imlistening.ca/](https://imlistening.ca/)  
Thanks you in advance.  
Lydia

 ![52%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/6/67b066bd3cd5fc7be20c6a77aeb3ef4d7676d466.png)

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 9:37pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/2 "2019-04-12T21:37:53Z")

</div>

I added in the following code in the head for the Google Tag Manager. Please see the attached for reference

 ![08%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/2/206105ec17c41f8c81d9d3d80899388a0cebf852.jpeg)

\< ! – Google Taq Manager →

\<l-- End Google fag Managel →

and the following in the body:

\<iframe src="https:/,/www.googletagmanager.com,/ns.html?id-GTM-TLBBC68TT  
height=“0” width=“0” style=“display:none;visibility:hidden”\>\<,/iframe\>  
\<l-- End Google Tag Manager (noscrj-pt) →

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 12, 2019, 10:01pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/3 "2019-04-12T22:01:23Z")

</div>

Can’t see what you added above.  
edit your post select(highlight) the code and mark it in the post as code \</\> above what you edit.

In the screenshot above (head section) can’t see what you have (truncated) but I can tell you it doesn’t look right. The first line looks to be an HTML comment and is missing the opening `<` , and the word tag is misspelled, the spelling doesn’t matter but the line not being a proper comment would. When you copy the code, make sure you copy all of it, and **paste as plain text** (cmd+opt+v.

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 10:06pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/4 "2019-04-12T22:06:52Z")

</div>

does this help?

```
< ! -- Google Taq Manager -->

```

\<l-- End Google fag Managel --\>

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 10:08pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/5 "2019-04-12T22:08:53Z")

</div>

![36%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/b/b69d302c69a09588fc8ee897b74e3b1baec90a41.png)

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 12, 2019, 10:17pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/6 "2019-04-12T22:17:42Z")

</div>

To mark code in this form you can select the code  
and choose the code button `</>`

![2019-04-12_15-10-36](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/5/5d438a78bd6192efdadebf1148a3c5847277802c.jpeg)

Or you start a line with three backticks ``` On most keyboards above tab and bellow esc key, paste the code in and on a line by itself tree backticks

![2019-04-12_15-15-24](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/1/1397a8f76f7d4e6eaa0c97013cf3da3129bd092d.jpeg)  
The result would look like this:

```auto
<!-- 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 -->

```

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 10:21pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/7 "2019-04-12T22:21:32Z")

</div>

```auto
< ! -- Google Taq Manager -->
<script> (function (w, d, s, I, i) {w If ] -w If ] I [] ;w[1] .push ( {' gtm. start' :
new DateO.get?imeO,event:'gtm.js'I);var f:d.getElementsByTagName(s)[0].
j=d.createElement(s),dl:1!:'datalayer'?r&l:'+I:";j.async=true;j.src=
'https://www.googletagmanager.com/gtm.ls?id=r+i+dl;f.parentNode.insertB.efore(j,f);
) ) (window, doclment,' script',' datalayer',' GTM-TLBBC68' ) ; </script>
<l-- End Google fag Managel -->

```

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 10:25pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/8 "2019-04-12T22:25:56Z")

</div>

Hi, I followed your instructions to send original code back to you. May I use the code your have replied with and pop it in the head of each page? Sorry I just wanted to be sure I understood. Thanks

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 12, 2019, 10:31pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/9 "2019-04-12T22:31:17Z")

</div>

Try remove what you have in the head section and pasting this **AS PLAIN TEXT** ( I took the container number you had in the post above):

```auto
<!-- 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-TLBBC68');</script>
<!-- End Google Tag Manager -->

```

The code I gave you orignally didn’t have your container number.

The code you had also had some messed up comments.

Here is a link to Googles instructions:

> **[ウェブページ向け Google タグ マネージャー
  
  |  Google Tag Manager for Web...](https://developers.google.com/tag-platform/tag-manager/web?hl=ja)**
>
> ウェブサイトで Google タグ マネージャーの利用を開始するためのリソースをご覧ください。

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 10:36pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/10 "2019-04-12T22:36:54Z")

</div>

Thank you so much!! It worked… That was some crappy code I received from the Ad guy. Would you be willing to look at this Facebook pixel code to see if it is faulty as well? thanks you!!!

```auto
<!-- Facebook Pixel Code -->
<script>
  !function(f,b,e,v,n,t,s)
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];
  s.parentNode.insertBefore(t,s)}(window, document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', '607287926413650');
  fbq('track', 'PageView');
 fbq('track', 'Lead');
</script>
<noscript><img height="1" width="1" style="display:none"
  src="https://www.facebook.com/tr?id=607287926413650&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

```

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 12, 2019, 11:47pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/11 "2019-04-12T23:47:53Z")

</div>

I don’t know much about FB. But here’s some instructions from them with link to sample code.

> **[Meta Pixel - Documentation - Meta for Developers](https://developers.facebook.com/docs/meta-pixel)**
>
> How to implement the Meta Pixel into your web app or website.

---

<div class="post-metadata">

**Author:** ![LCharak](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@LCharak](https://forums.realmacsoftware.com/u/LCharak)\
**Post date:** [April 12, 2019, 11:52pm UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/12 "2019-04-12T23:52:43Z")

</div>

Thank you Doug!!! The original code was from a scan - no wonder it was faulty. You’ve been a huge help.  
Much appreciated  
Lydia

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [May 13, 2019, 9:52am UTC](https://forums.realmacsoftware.com/t/google-tag-manager-visible-on-website/26275/13 "2019-05-13T09:52:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
