Support » Fixing WordPress » Google Analytics Code appearing twice

  • Resolved danieltamy



    For a few months now I’ve noticed that my bounce rate has fallen dramatically and didn’t know why. I didn’t discover any other issues in Google Analytics. However, after reading a little bit more about this and looking at the source code of my website I think I have the Google Analytics code appearing twice. The problem is that I don’t know why.

    I have the following active plugins on my website:
    Akismet, BWP Google XML Sitemaps, Google Analytics for WordPress, Jetpack by, nrelate Related Content, Sharebar, Smooth Slider, WordPress SEO, Wysija Newsletters

    Except the obvious one (Google Analytics for WordPress) I don’t remember any of the other asking me for this code and I don’t think I have ever inserted this manually on the page either. Any ideas how I can find out what’s happening? My website is


Viewing 6 replies - 1 through 6 (of 6 total)
  • You do have it installed 2 times but it is impossible to know why.

    I would open header.php under Appearance > Editor and see if it is manually entered there to start with it.

    Thank you Aaron. Just had a look in the header.php It was there as well. I have removed it and it now appears once but I have another mention above the main code.

    There is this code at some point in the header:

    <script type="text/javascript">
    	window.google_analytics_uacct = "UA-28075990-1";

    and then there is this code slightly lower down the page:

    <script type="text/javascript">//<![CDATA[
    			// Google Analytics for WordPress by Yoast v4.2.8 |
    			var _gaq = _gaq || [];
    			_gaq.push(['_setAccount', 'UA-28075990-1']);
    			(function () {
    				var ga = document.createElement('script');
    				ga.type = 'text/javascript';
    				ga.async = true;
    				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    				var s = document.getElementsByTagName('script')[0];
    				s.parentNode.insertBefore(ga, s);

    Is it ok to have it like this?
    Thanks again.

    You can remove the top one or leave it. Doesn’t matter.

    Isn’t this related to my Google AdSense account and to its integration with Google Analytics? I read about it here

    I don’t know for sure so I would just leave it. Wont hurt.

    Typically when I see those all it does is define the account number that it uses throughout the site.

    Thank you Aaron. Really appreciate your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Google Analytics Code appearing twice’ is closed to new replies.