google analytics java script in all pages (3 posts)

  1. tiberakis
    Posted 3 years ago #

    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') + '.google-analytics.com/ga.js';
        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: velespiegate.it

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

  3. tiberakis
    Posted 3 years ago #

    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="http://www.google-analytics.com/ga.js" 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.

Topic Closed

This topic has been closed to new replies.

About this Topic