Link to home
Start Free TrialLog in
Avatar of egoselfaxis
egoselfaxis

asked on

Google Tag Manager code blocking page rendering

We have Google Tag Manager tracking code scripts installed on this landing page that we created a while back:

https://www.evergladesholidaypark.com/tickets-lp/

These are the specific instructions that we followed exactly:

https://developers.google.com/tag-manager/quickstart

However, .. the page is for some reason not loading or displaying  correctly in any of these browsers that I've tested it with (on a Windows 10 PC):

Chrome
Edge
IE 11
Safari

The only browser that I've been able to get the page to load and display correctly in is Firefox Developer Edition v61.

Although you can view the underlying source code without any problems (and you'll see that there are many different javascript libraries being loaded), the only "invisible" stuff that's going on under the hood is PHP-based session management .. which I've already tried removing, .. though it didn't make any difference whatsover:

<?php 
  session_start();  
?>

Open in new window


Why is this happening?  The only clue I came across with this message in the console when trying to load the site in Chrome -- although I'm having a hard time translating it:

VM32:2 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ssl.google-analytics.com/ga_exp.js?utmxkey=71652754-1&utmx=&utmxx=&utmxtime=1526315626481, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.

Any help would be appreciated.

Thanks,
- Yvan
Avatar of Robert Granlund
Robert Granlund
Flag of United States of America image

Take out the tag manager code first.  And then test the site with a tool like YSlow and find the script that is taking to long to execute or load.  It may be that you have a plugin or s piece of code that is slowing things down to force this error.
Avatar of egoselfaxis
egoselfaxis

ASKER

We already tried that .. the page loads fine without GTM installed:

https://www.evergladesholidaypark.com/tickets-lp/index-test.php
Those are two different urls that you sent over.  The second with index-test.php loads fine.  the first one, without the tag code, as you mentioned, still unsuccessfully loads.  So when you have the Tag code on the page the second url fails?
This 1st URL has GTM installed and does not load:
https://www.evergladesholidaypark.com/tickets-lp/

This 2nd URL does NOT have GTM installed and it loads fine:
https://www.evergladesholidaypark.com/tickets-lp/index-test.php
If you load it on https://www.evergladesholidaypark.com/tickets-lp/index-test.php would you technically be loading it twice?
Do you have it setup in your htaccess or something to redirect without the index-test.php part?

Can you take the code out of: https://www.evergladesholidaypark.com/tickets-lp/
To see what happens and now have a look at the console?

Take it out of here:
https://www.evergladesholidaypark.com/tickets-lp/  For testing purposes.
We've already tested that exhaustively, and I just re-tested it once more just to make sure.  The /tickets-lp/ page loads fine when the GTM code is stripped out .. and it does NOT load at all when it's put back in.  The GTM code is currently back in place on the /tickets-lp/ page.  

Just to be clear -- these 2 pages are 99% identical.  The only thing that's different about them is that one of them does not contain the GTM tracking code in it.

Tag Manager code installed (does not load for me):
https://www.evergladesholidaypark.com/tickets-lp/ 

Tag Manager code not installed (loads fine for me):
https://www.evergladesholidaypark.com/tickets-lp/index-test.php

- Yvan
Avatar of Dave Baldwin
Please put comments in the 'index-test.php' version to show us where the code is in the original page.
Ok.  We're using GTAG instead of GTM and the code is different so I'm using it differently.
@egoselfaxis I would take any recommendation or suggestions that Mr. Baldwin is willing to offer . He has helped me sort out 100's of issues over the years.
@rgranlund, thanks for the vote of confidence.  I haven't seen anything yet on that page that I can see will make a difference.  When I try to run the original page, all that is left is this:
<script src="https://ssl.google-analytics.com/ga_exp.js?utmxkey=71652754-1&utmx=&utmxx=&utmxtime=1526335104780" type="text/javascript" charset="utf-8"></script>

Open in new window

I haven't been able to figure out how that is causing the page to refresh to nothing.  I would start with a simple page with the GTM code and add things until it breaks.  The current full page isn't giving any info that I can see.
Start by deactivating plugins and add them back in one at a time.
It's not a WordPress site.
ASKER CERTIFIED SOLUTION
Avatar of Robert Granlund
Robert Granlund
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
UPDATE:  It turns out that our simply renaming the sub-folder that contains the landing page file(s) resolved the issue.  We have no idea why, but the page is now loading correctly:

https://www.evergladesholidaypark.com/ehp-ticket-sales/

- Yvan
I have had that happen before.  I would like to know what causes that issue.  It can cause hours of frustration.
Wow!!!