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 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?
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)
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.