Analytics
2.8K members online now
2.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google Analytics not loading in Chrome

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
I hope someone can help me here because i've tried everything. When i access my website, it continually hangs on "waiting for google analytics.com.

I've copied the tracking script into the header part at the top of the page and in the header section and has it not done anything. I've also reset the DNS, clearing cache, deleted ad blocker....etc. Its got to be a technical thing somewhere.

The script i inserted includes:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxxxxx-1', 'auto');
  ga('send', 'pageview');

</script>
 
This issue does not occur with Firefox so i really do not know what google have done here but its dam right frustrating.

Any help on this would be greatly appreciated

1 Expert replyverified_user

Google Analytics not loading in Chrome

Top Contributor
# 2
Top Contributor

Hi @Bruce D

 

A link to the site will assist with troubleshooting

 

Thanks
Bronwyn

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Google Analytics not loading in Chrome

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Bronwyn,

 

The site is www.cubixglobal.com.au.

 

Also, i've removed the script but using google chrome the issue still exists.

Google Analytics not loading in Chrome

Top Contributor
# 4
Top Contributor

Thanks @Bruce D :-)

Does the theme have an option for adding script to the head of the site?
How are you currently adding it.. via the Squirrly SEO Plugin?

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Google Analytics not loading in Chrome

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

I am not really sure what you mean by the "head" of the site, basically i am just going into the Theme header folder and inserting the script in there. I've attached the images for you.

 

I sue squirly and Yoast SEO plugins. The both offer webmaster tools where you can place your tracking code.Capture.PNGCapture1.PNG

Re: Google Analytics not loading in Chrome

Top Contributor
# 6
Top Contributor

Thanks :-)


Editing a theme's core files (such as header.php) to make code edits, goes against WP best practices.

Reason being, is that when a theme gets updated, updates will overwrite and remove the code changes.

The recommendation is to use a plugin or to create and use a child theme.

 

Sometimes a theme will have an admin theme setting option for adding javascript to the head or footer of a site.

Looking at your site source code via browser, the following code indicates the GA tracking is currently being added using the Squirrly SEO plugin

<!-- Squirrly SEO Plugin 8.0.2, visit: http://plugin.squirrly.co/ -->
<meta name="description" content="project management, design construction and commercial service provider in Perth supporting engineering and construction industries across building construction, resources, property and infrastructure sectors" />
<meta name="keywords" content="design project-management construction procurement commercial" />
<link rel="canonical" href="http://cubixglobal.com.au/" />
<link rel="alternate" type="application/rss+xml" title="Home" href="http://cubixglobal.com.au/sitemap.xml" />

<link rel="publisher" href="https://plus.google.com/105731707814462157250" />
<meta name="dc.language" content="en-AU" />
<meta name="dcterms.rightsHolder" content="Cubix Global" />
<meta name="dc.publisher" content="Cubix Global" />
<meta name="dc.title" content="Home" />
<meta name="dc.description" content="project management, design construction and commercial service provider in Perth supporting engineering and construction industries across building construction, resources, property and infrastructure sectors" />
<meta name="dc.date.issued" content="2017-07-20" />

<meta property="og:url" content="http://cubixglobal.com.au/" />
<meta property="og:image" content="http://cubixglobal.com.au/wp-content/uploads/2017/02/Design-Development.png" />
<meta property="og:image:width" content="500" />
<meta property="og:title" content="Home" />
<meta property="og:description" content="project management, design construction and commercial service provider in Perth supporting engineering and construction industries across building construction, resources, property and infrastructure sectors" />
<meta property="og:site_name" content="Cubix Global" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />


<meta name="twitter:card" content="summary" />
<meta name="twitter:url" content="http://cubixglobal.com.au/">
<meta name="twitter:title" content="Home">
<meta name="twitter:description" content="project management, design construction and commercial service provider in Perth supporting engineering and construction industries across building construction, resources, property and infrastructure sectors | Cubix Global">
<meta name="twitter:image" content="http://cubixglobal.com.au/wp-content/uploads/2017/02/Design-Development.png">
<meta name="twitter:domain" content="Cubix Global">

<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-88972022-1', 'auto');ga('send', 'pageview');</script>
<meta property="fb:admins" content="286585575094799" /> <!-- /Squirrly SEO Plugin -->

I'm not seeing any issues with the tracking code itself. 
The site in general is loading very slowly, regardless of what browser I am using.

 

That particular SEO plugin has issued an update within the past 24hrs, if you run the update then you may find it helps the issue of the slow loading.


If you are using a 3rd party plugin to add the tracking code, then issues with the tracking not working or performing as expected should be taken up with the relevant plugin developer.

 

Thanks
Bronwyn

 

 

 

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Google Analytics not loading in Chrome

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi Bronwyn, thanks for the reply. so from your comments, you are saying that it is one of the plugins that is causing the site to hang, "waiting for google analytics"....is that correct.

Google Analytics not loading in Chrome

Top Contributor
# 8
Top Contributor

No, i cannot say for sure it is the plugin causing an issue.
Given that they have recently issued an update though, and that you appear to be adding the ga tracking via the plugin, then I would run the update and see if that improves the issue for you. 
I would also be sure to clear your browser cache and cookies too.

I am not able to reproduce the issue you are having re the "waiting for google analytics",

I'm simply finding that the site loads very slowly in an overall sense, not just on chrome for me but also firefox too.


Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Google Analytics not loading in Chrome

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

well actually i don't get any load problems with using firefox...the site hangs using google chrome. I've switched off both squirly and yoast and this hasn't fixed anything.

Re: Google Analytics not loading in Chrome

Top Contributor
# 10
Top Contributor

Bruce D wrote:

well actually i don't get any load problems with using firefox...the site hangs using google chrome. I've switched off both squirly and yoast and this hasn't fixed anything.


In which case, analytics is not being loaded at all.. yet the issue remains.
Which indicates the site's slow loading is being caused due to something else
that is running on the website


Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here