2

I'm stucked on copying google analytics tracking code issue. It looks like Google Tag Assistant doesn't consider the code I copied from the generated GA tracking JS for the site.

The site is in http://www.orchid.co.nz/

I added the codes on the header. This should work correctly like what I'm doing with the other sites I worked with. However, this one is weird. I can't figure what's wrong.

Anything I missed? enter image description here

Jed
  • 1,664
  • 8
  • 33
  • 65

4 Answers4

6

This error is caused by Cloudflare as it implements rocketscript to speed up the web load speed. Disabling the cloudflare will fix this but you don't need to do that. There is simple code to make cloudflare ignore that particular javascript code. Simply Change

<script type="text/javascript">

to

<script type="text/javascript" data-cfasync="false">

This is most efficent way.. Thanks :)

Parth Patel
  • 292
  • 3
  • 10
5

Not sure if this will fix the issue, but you are telling the browsers to parse the script as "rocketscript":

<script type="text/rocketscript">
  (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');
....

I don't know what rocketscript is and I guess neither does the Tag Assistant. Try to change this to "javascript" or not to use a type attribute at all.

Here is a discussion about rocketscript, apparently this is part of some Cloud technology and requires a special plugin in Wordpress.

I see tracking calls in the network tab of the browser, so it looks like the problem might very well be purely cosmetic (altough chromes GA debugger extension does not pick up the calls, either).

Community
  • 1
  • 1
Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • 1
    Thanks Eike for you answer. How did you know that the site is parsing the script as rocketscript? – Jed Jan 29 '15 at 09:04
  • Thanks Eike for giving me the idea that its a cloudflare issue. I turned off the cloudflare that was set up on the site. The GA script is working fine now. Thumbs up for giving me the hint! Cheers! – Jed Jan 29 '15 at 09:07
  • You are welcome. I simply looked at the source code, and since I found that wrong type attributes are usually a problem in script tags I figured that might be it. – Eike Pierstorff Jan 29 '15 at 09:09
3

it might be late but the solution for this is : adding the option data-cfasync="false" in your analytics.js.

this has to do with cloudflare Seee reference here http://www.aodba.com/fix-redundant-hostname-warning-google-analytics/

Up_One
  • 5,213
  • 3
  • 33
  • 65
2

The quick solution. If nothing works with the code: Turn off the feture. Menü: Speed ->Rocket Loader™ BETA -> Off

enter image description here

techspider
  • 3,370
  • 13
  • 37
  • 61
Tom
  • 21
  • 1