WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Where should I paste the Google analytics code?

[Resolved] Where should I paste the Google analytics code?

  • Hi all,

    I’m wondering which file I should paste my Google analytics code into. I’ve been pasting it into the Main Index Template (index.php), before the first <?php tag, but perhaps it should go somewhere else?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • as long as it comes before the </head> line you should be okay…

    My suggestion would be to use a widget (my personal favorite is Google Analyticator… http://ronaldheft.com/code/analyticator/) it will be seamless and add a quick-view to your admin dashboard.

    In general using plugin’s are a good way to go about getting the things you want done while you wrap your head around how to use PHP.

    good luck 🙂

    esmi

    @esmi

    Forum Moderator

    as long as it comes before the </head> line you should be okay…

    Huh? The analytics code is best placed in footer.php – just before the </body></html> tags.

    Oh I see. Because in the footer the site can begin to render before it’s all loaded.

    Thanks 🙂

    Thanks, got it!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Where should I paste the Google analytics code?’ is closed to new replies.
Skip to toolbar