Support » Fixing WordPress » google analytics java script in all pages

  • I recently followed the instructions for installing my google analytics code in some page:

    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-36765049-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);

    As I got some problems with sitemaps, I removed that code from each page. Surprisingly the removed code is still present in the source code of each page, and it still gives me problems with sitemaps.
    How can I remove that code? I am really becoming mad about that problem.
    Thank you in advance.
    My site is:

Viewing 2 replies - 1 through 2 (of 2 total)
  • Christine Rondeau


    Volunteer Forum Moderator

    Check your header.php template in your theme directory.
    That’s where the GA code normally gets inserted.

    Thank you Christine,
    but I don’t find the code in the header.php of my theme. If I activate another theme, the code is still there.
    With firefox “view generated source” I get:
    <html class=" js rgba backgroundsize borderradius boxshadow textshadow opacity cssgradients csstransitions generatedcontent" dir="ltr" lang="it-IT"><head><script src="" async="" type="text/javascript"></script><script type="text/javascript">
    When I use “inspect element” on the google analytics java script, it seems to match the rules of a “user agent stylesheet”, but I can’t find a similar stylesheet.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘google analytics java script in all pages’ is closed to new replies.