Analytics
4.9K members online now
4.9K 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 & Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi guys,

 

I am using Wordpress with google analytics.

 

Since a week ago I don't receive any information on my Google Analytics account (0 visit). I tried to remove and replace code but nothing changed. I checked with Google Tag Assistant extension and it shown 2 errors messages said

  • "No HTTP response detected"
  • "Missing analytics.js script"

 

I have no idea what to do. Any idea?

Thanks a lot!


Tom

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Thomas
June 2016

Re: Google Analytics & Wordpress No HTTP response detected + Missing analytics.js

Top Contributor
# 2
Top Contributor
1) Make sure the tracking script is installed
2) Make sure in the Google Analytics interface, in the Property Settings and all View Settings that the website url is entered correctly
- Should be the same as the Site Address (URL) in the wordpress Settings > General page
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Thomas
June 2016

Re: Google Analytics & Wordpress No HTTP response detected + Missing analytics.js

Top Contributor
# 2
Top Contributor
1) Make sure the tracking script is installed
2) Make sure in the Google Analytics interface, in the Property Settings and all View Settings that the website url is entered correctly
- Should be the same as the Site Address (URL) in the wordpress Settings > General page
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 & Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Bronwin V,

Thanks for your answer. I double checked and everything is ok.
I even tried to install the script with some extensions or to paste it directly in the header file but nothing changed. My website if it can help: http://le-bon-profil.com/

Thanks a lot!
Thomas

Re: Google Analytics & Wordpress No HTTP response detected + Missing analytics.js

Top Contributor
# 4
Top Contributor
Hi :-)
The tracking code seems to be installed more than once in different configurations.
Having it installed more than once is going to give errors, specially when both codes are different yet for the same Property ID.
Please ensure only a single instance of code is installed.

Ive written an article that explains how to install the tracking in a couple of different ways:
https://www.bronv.com/how-to-install-google-analytics-in-wordpress
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 & Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hey Bronwyn,

 

I'm having a similar problem. 

  • I followed the advice on GA
  • Created the analyticstracking.php file, added the GA code snippet,
  • Added <?php include_once("analyticstracking.php") ?> the the parent theme header.php file,
  • When looking at the site with Dev tools, the GA code appears there, right after the <body> tag,
  • But when using the Tag Assistant I still get "No HTTP response detected", even though it's there.
  • I've reinstalled it, but still get the error,
  • I get the same Tag Assistant error for all recorded pages I've visited,
  • Also, I've recently migrated from HTTP to HTTPS, checked the two boxes in WP Settings > General, added the HTTPS version to Search Console, and made HTTPS the default URL in GA Property Settings.

Any suggestions?

Google Analytics & Wordpress No HTTP response detected + Missing analytics.js

Top Contributor
# 6
Top Contributor

Hi @Ronando L 

Sorry for the delayed response the notification system has been a bit wonky.

  • Added <?php include_once("analyticstracking.php") ?> the the parent theme header.php file,

If you are using a child theme of a parent theme, the tracking should be added via the child theme. This is why a child theme is used, to avoid making modifications to a parent theme's files as code edits will get overwritten and removed when the parent theme gets updated.

 

Also if placing the code into the child theme's header.php.

the php include file analyticstracking.php is unnecessary.
Simply paste the script code in before the closing </head> tag

Also if you have just changed from http to https have you checked that

the site is all redirecting as expected to the https version of the pages

 

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

Google Analytics & Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thanks. I found the solution, it was actually in the message of the Tag Assistant. One of my extensions was messing with the GA tag. After I turned them all off I was able to get a green light on the GA tag. I simply reactivated the extensions I needed and everything worked out fine.

 

Google Analytics &amp; Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

I'm having the same problem.  My analytics is showing hits, but not as many as I drive with google ads.  It's not showing those views.  Everything shows the google tracking working, but then my hits are not accurate and I get messages that there is no tracking code and Tag Assistant says No HTTP Response Detected.

 

The website is wakefieldpetvet.com

 

the following is the script

 

   <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-10528263-7', { 'cookieDomain': 'www.wakefieldpetvet.com','allowLinker': true } );
   ga('require', 'linker');
   ga('linker:autoLink', ['wakefieldpetvet.com'] );
   ga('send', 'pageview');
   </script>

Re: Google Analytics &amp; Wordpress No HTTP response detected + Missing analytics.js

Top Contributor
# 9
Top Contributor

@Bob M :-)

 

Hi :-)

My Antivirus wont let me access your website. You may want to check that your site has not been compromised in some way.

 

One issue i am seeing with your tracking code.. www.wakefieldpetvet.com is a subdomain of wakefieldpetvet.com.
Usually they would both serve the same content.

A cross domain tracking setup is not required for this,

a subdomain tracking setup is used, which simply needs the cookie domain to be set to auto

and the non-www domain to also be added to the referral exclusion list

 

<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-10528263-7', 'auto');
  ga('send', 'pageview');

</script>

You should then have at least two Views created..All Website Data the default View is usually kept without any filters applied to it,

this way you then always have an unedited copy of tracking data should it be needed at any stage

 

and then a "Master" View with at the very least a hostname filter applied to it.

Then make sure in the Google Analytics interface, in the Property Settings and all View Settings that the website url is entered correctly 
- Should be the same as the Site Address (URL) in the wordpress Settings > General page

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

Google Analytics &amp; Wordpress No HTTP response detected + Missing analytics.js

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

I've corrected the script, via the plugin, to not indicate a subdomain www

 

<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-10528263-7', { 'cookieDomain': 'wakefieldpetvet.com','allowLinker': true } );
   
   ga('send', 'pageview');
   </script>


Do you think I need to make additional changes to track www ?

If yes, can you include screen shots - I'm feeling a bit ignorant with google analytics these days.

And, thanks for all your help