WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Google Analytics Code appearing twice (7 posts)

  1. danieltamy
    Member
    Posted 1 year ago #

    Hi,

    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 WordPress.com, 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 augmentedtomorrow.com

    Thanks,
    Daniel

  2. Aaron
    Member
    Posted 1 year ago #

    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.

  3. danieltamy
    Member
    Posted 1 year ago #

    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";
    </script>

    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 | http://yoast.com/wordpress/google-analytics/
    			var _gaq = _gaq || [];
    			_gaq.push(['_setAccount', 'UA-28075990-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>

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

  4. Aaron
    Member
    Posted 1 year ago #

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

  5. danieltamy
    Member
    Posted 1 year ago #

    Isn't this related to my Google AdSense account and to its integration with Google Analytics? I read about it here http://www.labnol.org/internet/enable-analytics-for-google-adsense/6029/

  6. Aaron
    Member
    Posted 1 year ago #

    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.

  7. danieltamy
    Member
    Posted 1 year ago #

    Thank you Aaron. Really appreciate your help.

Topic Closed

This topic has been closed to new replies.

About this Topic