As Theme Playground approaches the end of its first week online I decided it would be a good idea to set up Google Analytics to track the stats. And it seems only fitting that we take this opportunity to, together, walk through the steps of setting up Google Analytics on a Wordpress blog.
Google Ana-what?
Google Analytics is the mega-giant Google’s version of stat-tracking. They are also, arguably, the best available.
Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website…Most important, a webmaster can define and track conversions, or goals. Goals might include sales, lead generation, viewing a specific page, or downloading a particular file. By using this tool, marketers can determine which ads are performing, and which are not, as well as find unexpected sources of quality visitors.
Just to give a taste of what we’re talking about.
I have, honestly, never used Google Analytics before. In the past I’ve tried other stats tracking plugins for Wordpress (not to mention Wordpress.com’s official stats plugin earlier this week) but nothing ever worked out. So, on to the big boys.
Let’s install it already.
First Things First
Do you have a Google account of some sort? You will need one. That’s okay if you don’t, you can grab one during the process.
Hit up the following link: http://www.google.com/analytics
Now is the time to sign in. Look to the box on the right. If you don’t have a Google account, you will be prompted to sign up now. Do it.
I’ve signed in with my info above. And don’t both trying to get in, it’s hopeless :).
If this is your first time stepping into Google Analytics (which it probably is) then you’ll see a screen prompting you to enter the information for the website you are wanting to track. If you don’t have a website…well…um…why set up an analytics account?
Seriously. Why bother?
So assuming you have a website, throw the address in there with all the information it asks for.![]()
Next it will want your name (no cheating) and number, same as any first date would expect. Again, throw all the info they want into the boxes and hit Next.
Finally, make the Google lawyers happy by agreeing to their terms of service. I would tell you what is written there, but I have no idea. Who actually reads that stuff anyway?
Create New Account. Done and done.
Well, not quite.
Plugging into Wordpress
A brand new screen should be showing, prompting you to drop a set of code into the footer of your website pages. It should look something like this:
(Click above for a larger view)
This is where having a Wordpress blog makes life easier. Google wants to converse with your website (just like you’ve asked it to) but needs a certain Javascript code to be at the bottom of every page of your web site. If your site is static, this can be a pain, or at least an annoyance. But since we’re using Wordpress, and everything is dynamic, we only have to copy and paste once.
Log into your dashboard (preferably in a new window) and browse to Presentation > Theme Editor > footer.php.
Note: This is assuming that you are using a fairly standard Wordpress theme which uses footer.php as the final template of a page. If this is not how your blog is set up and you can’t figure out where to go, post a question in the comments to this post.
Take your Google Analytics code and paste it into your footer.php file in Wordpress. It shouldn’t be all that important where the file goes as long as it comes before the ending body tag. In other words, just put your GA code where I indicate in the following screen:
Of course hit Update File. As far as Wordpress activity goes, you’re set! Nice work.
Check Status and Analytic Stats
A nice big button on your Google Analytics homepage should say Check Status. You’ll want to click that so Google can start communicating with your website.
Now all you have to do is bookmark Google Analytics and keep an eye out. Of course it will take a few days before any stats start showing up. Believe me, I know. The stats for this site are still in the collection stage.
Whatever you do, don’t get into the habit of checking your stats every 5 minutes or else…oh, hey, sorry I have to go…yeah, you know.
Note: Having problems? Post a comment below and I’ll see what I can do.






35 Comments
Hello! Thanks for publishing such a nice set of instructions! I am using the Blix theme and it doesn’t seem to have a “Theme Editor” option and I was wondering if you could help me get around this?
Thanks,
Victoria
Hey I am not able to see the “Presentation > Theme Editor >” on my wordpress blog. All options I have under Presentation are Themes, Widgets, Extras and Edit CSS. Can anyone help me with this. I want to add analytics script to my wordpress blog to get the stats.
Oh, I see. You have a Wordpress.com website. The above instructions are meant for someone running a Wordpress site on their own.
I don’t know exactly how to set Analytics up on a Wordpress.com site. I just tried playing with it, no luck. I’ll see what I can find out.
Does anyone else have an idea?
Thanks for the walk through! It was nice to be baby stepped through it. It’s working great.
Oh, Thanks for your tutorial.
I’m new to WP and just set up my first site http://www.mymusicz.com .
Many thx for this again.
Thanks Alot, I knew it was something simple, yet just couldnt understand how to get there. Nice simple laid out help.
Cheers Bro.
Nice tutorial there. Very useful.
Cheers!
Mani
Thanks for clearing up the mystery so easily!
Of course, Daniel. I’m glad you found it useful.
Thanks for the info. We just transferred our blog from Blogspot to Wordpress and I had no idea where to put the Google Analytics code. I knew the answer would be on the internet somewhere.
Hi, great tutorial. I am new to wordpress and trying to install the google analytics code. Having the following problem:
I have no idea how to get to the point where I can edit the footer.php file from my admin area.
When I go to presentation, then theme, there is no where to edit the footer??
Any help would be appreciated.
thanks!
Nice article, but unless you’re implementing a plugin, why not use an existing plugin to do this? WordPress Reports will insert Google Analytics code for you and give you some overview reports from their API within your WordPress control panel. And it will also show your FeedBurner stats if you choose.
If you don’t want the reporting feature (why not?), you can use the Google Analyticator plugin to insert the analytics code, including for outbound link tracking, for you.
Good post. I recommend putting the Analytics code into a widget rather than editing your footer.
That way if (when
) you change your theme, you don’t have to move all your stats codes, the widget will migrate them all for you.
Happy blogging,
WordPress Ninja
Thank you! Your instructions are clear and easy to follow. Google analytics is now gathering data, and in a matter of minutes you solved a problem I could not figure out in a couple hours. Your willingness to share this great content is truly apprciated!
Los armiger bandit köpfe darunter fassen Bingo haltbar jackpot slot machine spielen Symbole handicapper Doppeltes Klaps freundchen casinos im internet Gutschrift poker Zeichenkette Könige!
Estimer geld gewinne entrega uniforme basica casino portales web niquel medio jovial excedente spiel automaten esquina gratis rapido Pasadena.
Complet les meilleures casinos promotions tutoria empirepoker par terraplen ganar la ruleta handicapper gerencia em casino top casinos en ligne captura representar oprimido reinas macho par?
Thanks so much for this excellent tutorial. And to everyone who posted suggestions for widgeets etc. My question is as follows: Can I do more detailed tracking from withing wordpress, and across multiple sites that include wordpress sites? To be more specific, I am looking to track email submissions on a separate site (which I guess I could track through wordpress because the successful signup page is on wordpress), then track whether they are opening the newsletter they signed up for, and then link the original traffic or campaign source (and purchase value) to the actual product purchases they make by following links in the newsletter to a purchase form being hosted on totally different enterprise software app…..gads, sounds complicated…any help appreciated.
http://www.google.com
http://www.yahoo.com
http://www.msn.com
i dont understand how to put the google analytics code in word press blog.
when i m going to dashboard - Presentation > Theme Editor
But i cant find Theme Editor option in wordpress blog.
Please let me know how to put the google analytics code in word press blog.
Please give me perfect guidelines for blog
http://dominiek.com/articles/2008/1/6/building-a-com-in-24-hours/comments/13639#comment-13639
can you please tell me axactly where to paste the google analytics code at on this theme http://www.wpthemesfree.com/view.php?theme_id=1267
Some upload mp3 ringtones tell ball carribean freezeout kings under treo 680 mp3 ringtones clubs partypoker blind free cricket motorola ringtones third main bottom scalper.
Hy,
I have a problem with my wordpress theme. Footer.php looks…strange and I cannot find .
This is my footer.php data:
“”
Can you, please, help me?
10x
Sorry for the error.
thanks you really helped me, i was trying to set the wordpress plugin but it didnt work and i had no idea why
Hello,
Thanks for the great instructions, really made it simple to follow and complete.
Thanks again, will be checking rest of site to see what other good posts you have.
Regards
Mike
lasventions.com/specials
Great tutorial. I really helped a lot…
One question, though…
Wouldn’t it be easier to paste to code on an untitled Text/HTML widget on a sidebar (that is always present on every page across the entire site) then to edit the footer code?
Just a thought…
Thanks for the tut
Leo
Hello,
I have installed Analystics in the footer with no problems. I’ve heard though that if you install it in the header you receive more visits… do you have any information on that? Thanks.
Is it possible to include Adwords in wordpress.com?? Can u suggest any way to generate revenue from wordpress.
Thankee, thankee, thankee!
I’ve been trying to figure this out for several hours until I found your blog on google.
It only took about 10 min. after I saw this.
Thanks again
Duane
Thanks for the help!
Im having some trouble…
I input the tracking code in the footer.php file, before the body tag. But when I got to Google Analytics to “check status”, I get a message saying the code isnt installed.
I tried using both codes (legacy & new tracking) and both bring back the same responds.
Whats going on?
Thanks for great instructions. They were so easy to follow. Cheers!
Hi your tutorial on how to install Google Analytics is clear but my template is bluebusiness and I cannot seem to update the footer.php file - can you tell me where else i can install the code on this template please? Thanks
6 Trackbacks
[...] Ryan’s been pumping out some great reviews already … as well as some great tutorial posts like How to Install Google Analytics Stats in Your WordPress Blog. [...]
[...] Check it out! While looking through the blogosphere we stumbled on an interesting post today.Here’s a quick excerpt [...]
[...] By the way it’s incredibly easy to install, which I learned from this site here: http://themeplayground.com/how-to-install-google-analytics-on-your-wordpress-blog [...]
[...] http://themeplayground.com/how-to-install-google-analytics-on-your-wordpress-blog [...]
[...] this Theme Play Ground post about installing Google Analytics for WordPress and zerodollarchallenge for [...]
casino en ligne net…
Cher baccarat online web casino jack black strategien gioco online casino games…