Problem connecting with Google tag manager

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Problem connecting with Google tag manager

Post by tba »

Hi.
I am trying to connect a Gooogle ad campaign to my website and have used the Google tag manager to generate the TAG code to be inserted in the page <head> and <body> sections as follows

HEAD
<!-- 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 =d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js ... efore(j,f);})(window,document,'script','dataLayer','GTM-PD5KD8NL');</script>
<!-- End Google Tag Manager -->

BODY
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.htm ... "height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Google TAG manager however gives the following error message;

A timeout occurred while attempting to connect to https://www.gubbhost.se/

I have loaded this website into my browser and used the inspector to see if the code is there .. you can check this for yourself.

My consultant at Google suggests the problem is caused by the Google Tag not being high enough in the <head> section.

Can you confirm that this is the cause of the problem or if not then perhaps suggest what could be causing the issue.

Many thanks
User avatar
Pablo
 
Posts: 22422
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Problem connecting with Google tag manager

Post by Pablo »

You have placed the code in the wrong section of the page.
The code is inside the body tag, this is incorrect. This section may only have HTML attributes.
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

no I don't think so. Can I upload a screenshot to this forum?
User avatar
BaconFries
 
 
Posts: 5619
Joined: Thu Aug 16, 2007 7:32 pm

Re: Problem connecting with Google tag manager

Post by BaconFries »

No not directly as uploading image to the forum is disabled. As an alternative you can use the following.https://imgbb.com/
or you can upload to your own host/server and provide a url to it.
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

I have removed the code from the <body> section and uploaded the page and verified that it has been updated but the problem remains. The google code is in the <head> section of the page but the tag manager can not connect

I surely am not the first person to attempt this using a page created with WYSWYG ?
User avatar
BaconFries
 
 
Posts: 5619
Joined: Thu Aug 16, 2007 7:32 pm

Re: Problem connecting with Google tag manager

Post by BaconFries »

no I don't think so. Can I upload a screenshot to this forum?
As Pablos reply you have placed the code inside the body tag

Code: Select all

<body 
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.htm ... "height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) ->>  
This can be seen in the html see screenshot to show this
Image
User avatar
Pablo
 
Posts: 22422
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Problem connecting with Google tag manager

Post by Pablo »

If you want to place the code at the top of head tag then you will need to place in 'user defined' section of the meta tags.
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

ok done that and now Google tag manager can connect but gives the following error message

https://ibb.co/YQ17gd0

also curious as to why the code is still in the <head> section when it has been removed ? (bug??)

https://ibb.co/NZcryH0
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

also it seems that there is an error in the Google Tag code... could this be the problem?

https://ibb.co/d7Zzskn
User avatar
crispy68
 
 
Posts: 2907
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Problem connecting with Google tag manager

Post by crispy68 »

One problem i see from your screenshot it that you have the <script> tag before the Doctype!
This is incorrrect. Remove this.

the script tag should be placed in the <head> section as close as possible to the opening <head> tag if possible. The <no script> tag should be placed immediatley after the <body> tag (this can be chosen as one of the options in the html box).

I don't think you should have an issue if the <script> tag is not the first thing in the head but test and see. Publish the page to your disk and then open the html page in notepad and move the <script> tag up right after the head tag and upload it to your server and see if it makes a difference.
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

""(this can be chosen as one of the options in the html box).""

where can I find 'the option box' in the HTML box?
User avatar
crispy68
 
 
Posts: 2907
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Problem connecting with Google tag manager

Post by crispy68 »

In the "Type" drop down box.
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

hmmm.. are we using the same system?

https://ibb.co/DKXkMbz
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: Problem connecting with Google tag manager

Post by tba »

problem solved. The Google tag must be directly after the <head> tag thus...

<!doctype html>
<html lang="sv">
<head>
<!-- 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 ... efore(j,f);})(window,document,'script','dataLayer','GTM-PD5KD8NL');</script>
<!-- End Google Tag Manager -->
<meta charset="utf-8">
<title>Gubbhöst teater i eskilstuna teater i sörmland riksteatern sörmland</title>

-------------------------

now Google tag manager can connect. If this is correct then pls (Pablo) update the online help. If this is incorrect pls suggest the correct and tested way of doing this
Post Reply