Where do I put Google Analytics code?


#1

I’ve installed WordPress at the root of my domain and I want to use Google Analytics to monitor traffic, etc.

What file should I put Google code in to get data for my whole site?


#2

Your main index template, at least … maybe also in your pages or other special templates, depending upon your site’s design and theming. :wink:

–rlparker


#3

in post-template.php
or
index.php
or
general-template.php
or
all of the above?

(thank you for your help)


#4

Well, it all depends upon your site. You might actually have a lot better luck just using one of the many Google analytics plug-ins that are available for WordPress.

I don’t know why I didn’t think of that earlier when I first responded; it should be a lot easier than embedding the code in your templates.

Check via Google or on the WordPress Extensions site (maybe "Google Analytics For WordPRess"?), and you should find something you like that will make life a lot easier. :wink:

–rlparker


#5

will do rlp, thanks again.


#6

No Problem, and you are welcome! Good luck, and post back letting us know which one you chose! :wink:

–rlparker


#7

I use Google Analyticator.

3 extra lifetime domains and $52 off with code [color=#CC0000]3DOM52[/color] or use [color=#CC0000]LM97[/color] for $97 off. More Dreamhost coupons