Where do I put Google Analytics code?

Where do I put Google Analytics code?

Posted by: incredulity
Posted on: 2007-12-10 11:29:00

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?

Re: Where do I put Google Analytics code?

Posted by: rlparker
Posted on: 2007-12-10 11:37:00

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

Re: Where do I put Google Analytics code?

Posted by: incredulity
Posted on: 2007-12-10 11:46:00

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

(thank you for your help)

Re: Where do I put Google Analytics code?

Posted by: rlparker
Posted on: 2007-12-10 11:52:00

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

Re: Where do I put Google Analytics code?

Posted by: incredulity
Posted on: 2007-12-10 11:54:00

will do rlp, thanks again.

Re: Where do I put Google Analytics code?

Posted by: rlparker
Posted on: 2007-12-10 11:56:00

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

--rlparker

Re: Where do I put Google Analytics code?

Posted by: Lensman
Posted on: 2007-12-10 13:30:00

I use Google Analyticator.

Tags: trafficgoogle