Where do I add the analytics tracking code on a WP blog?

Discuss webmaster issues, website development and resources. Ask questions about website building, coding, SEP/SEO etc here. NO ADS!

Moderators: magnetize, Oosha, ftello, shezz

Where do I add the analytics tracking code on a WP blog?

Postby TrentBrownrigg » Sat Nov 28, 2009 10:41 pm

It says to paste it onto every page you want to track immediately before the </body> tag.

I've done it on static sites before but I am wondering where exactly I would paste it into a wordpress blog?

Here's the blog if it matters: http://work-at-home-based-business.com
* No links here... Search my name if you want to find me!
TrentBrownrigg
 
Posts: 471
Joined: Tue Feb 24, 2009 1:11 am
Location: Iowa

Re: Where do I add the analytics tracking code on a WP blog?

Postby James » Sat Nov 28, 2009 11:09 pm

I place it just before the </body> tag on the main page (index.php) and it works like a charm ;)
James
 
Posts: 540
Joined: Fri Apr 18, 2008 10:47 am
Location: Serbia

Re: Where do I add the analytics tracking code on a WP blog?

Postby Tel » Sat Nov 28, 2009 11:21 pm

Depends on the WP template, but If there's a "home.php", a "single.php" and a "page.php" page, I'd also place it in there too.

Some WP templates place the closing </body> tag in the footer ("footer.php") which is really useful as then you only have to place the code in the one file!
User avatar
Tel
Site Admin
 
Posts: 2919
Joined: Sun Mar 25, 2007 4:52 am
Location: Spain

Re: Where do I add the analytics tracking code on a WP blog?

Postby DeMerchant » Sat Nov 28, 2009 11:29 pm

I just started using this plugin on one of my sites and it seem to work pretty well:

h**p://plugins.spiralwebconsulting.com/analyticator.html
User avatar
DeMerchant
 
Posts: 610
Joined: Fri Apr 18, 2008 12:00 pm

Re: Where do I add the analytics tracking code on a WP blog?

Postby Brawnydt » Sun Nov 29, 2009 12:28 am

Sidebar widget works too usually if it appears on every page.
User avatar
Brawnydt
 
Posts: 366
Joined: Sun Dec 07, 2008 6:34 pm
Location: Sunny California

Re: Where do I add the analytics tracking code on a WP blog?

Postby DavidO » Sun Nov 29, 2009 5:04 am

I stick it in the footer since that is where the </body> usually is. There is also an analytics plug-in by Joost that makes it easy.
DavidO
 
Posts: 286
Joined: Tue Jun 17, 2008 8:31 am
Location: San Diego, CA

Re: Where do I add the analytics tracking code on a WP blog?

Postby Scooter » Sun Nov 29, 2009 5:21 pm

Like DavidO stated, there is a WP Plug-in that makes this a breeze.

You can go here to download the plug-in:
h**p://yoast.com/wordpress/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=google-analytics-for-wordpress
Then simply upload it to your site, activate it, and edit the info to include your tracking code.
Scooter
 
Posts: 65
Joined: Sat Apr 04, 2009 7:32 pm
Location: Wisconsin. USA

Re: Where do I add the analytics tracking code on a WP blog?

Postby TrentBrownrigg » Sun Nov 29, 2009 11:25 pm

Thanks for all the answers!
* No links here... Search my name if you want to find me!
TrentBrownrigg
 
Posts: 471
Joined: Tue Feb 24, 2009 1:11 am
Location: Iowa


Return to Web Development Resources

Who is online

Users browsing this forum: No registered users and 1 guest

cron