Analytics
1.6K members online now
1.6K 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

Both urls are being output to page.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 1 request(s) and 42.1KiB.

http://www.google-analytics.com/ga.js
https://ssl.google-analytics.com/ga.js

The code snippet I believe is causing this:

 

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-43332862-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src=('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

Site is on wordpress. The inspector console shows 

http://www.google-analytics.com/ga.js

in the header and the ssl url in the footer. Also the header ga.js returns "undefined". 

1 Expert replyverified_user

Both urls are being output to page.

Top Contributor
# 2
Top Contributor

Hi,

 

The above code is for the outdated classic analytics. I would suggest you to replace it with the Universal Analytics tracking code. You can find the Universal Analytics tracking code in Admin -> Property -> Tracking Info -> Tracking Code.

 

Check the document below for more details about adding analytics to a website:

https://developers.google.com/analytics/devguides/collection/analyticsjs/

 

For Wordpress I'd recommend using a plugin like https://wordpress.org/plugins/pc-google-analytics/

 

Make sure you remove the old tracking code in order to avoid tracking duplicate pageviews.

 

Hope this helps, let me know if you have questions.

 

 


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Both urls are being output to page.

Visitor ✭ ✭ ✭
# 3