Google Analytics by MonsterInsights
[Plugin: Google Analytics for WordPress] Google analytics for wordpress not inserting code into head (1 post)

  1. pete101
    Posted 4 years ago #

    I've been having a problem with the google analytics for wordpress plugin, it says in the settings by default it inserts the code into the header but when i check my header.php in editor in my theme it is not there!

    it is not in the footer either.. where could it be?

    the strange thing is that google analytics is working fine BUT i am not sure if it will track every page.

    i understand normally it should be in </head> or around there for the header and </body> in the footer.. where on earth is this google analytics code then?

    and will this have an impact on the tracking if i do not know where it is?

    i have checked the source code and about half way down i get this:

    script type="text/javascript">//<![CDATA[
    // Google Analytics for WordPress by Yoast v4.2.3 | http://yoast.com/wordpress/google-analytics/
    var _gaq = _gaq || [];
    (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);

    the plugin is working and tracking BUT because it is not in header.php or footer.php i have no idea where the code has been inserted to?

    surely the idea of the plugin is to insert the code for you so you dont mess with the code BUT if it does not work normally you would insert it manually then save the changes.. thus meaning it will be in header.php or footer.php

    i understand it might be my theme that is clashing with the plugin but will it still track all my data/pageviews even if it has been put somewhere else on my site? does it have to be put in either the header or footer in order for google analytics to work properly?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics by MonsterInsights
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.