• I am trying to set up Google Analytics to my WordPress site. Google Analytics is telling me to paste the code into my page before the closing Head tag (/head). Where do I access that page? I’ve downloaded my site and I’ve attached a screen capture of the header.php file thinking that maybe it goes there. https://screencast.com/t/L30PHUiMhD

Viewing 1 replies (of 1 total)
  • Hi,

    What template do you use, because normaly it looks a little different.

    Example :

    /* Always have wp_head() just before the closing </head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */
    wp_head();
    ?>
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-11111111-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' : 'https://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
    </head>
    <body <?php body_class(); ?> id="top">

Viewing 1 replies (of 1 total)
  • The topic ‘Setting Google Analytics to my WordPress site’ is closed to new replies.