How to Link Up your WordPress with Google Analytics (Part 2)

Part 2 in a series of posts about hooking up your WordPress site with search analytics. Read part 1 here

I’ve already covered how to link your free wordpress website with Google & Bing Webmaster tools. This will enable to to see limited features such as search traffic, but more importantly it will let you know if there are any problems that might prevent your site from being indexed.

If you want to delve deeper into the analytics then you’ll need to upgrade your WordPress account in order to access the full tools available in Google analytics. If you thought WordPress analytics were extensive, you’re in for a treat. Google analytics turns me into a kid at Christmas.

Getting Analytical with WordPress

While WordPress may give you information about how many people visit your site, where they’e from, and what they click on, this is nothing compared to the information available on Google analytics. You’ll get to see how long people spend on your site, the path they take as they wander through your site, and also where they enter and leave your site. This is all invaluable to optimising your content for your audience.

Step One: Sign up for a free Google Analytics account here.

Step Two: From the Admin panel click on ‘New Account’.

Step Three: Fill in the information form and click submit.

Step Four: You will be given a snippet of HTML code which needs to be inserted into your site. There are several ways you can achieve this.

1. Paste the code directly into the php code. Don’t be intimidated by this, you won’t have to make any changes. Simply copy the code and paste it into the footer.php file above the </body> tag.

2. Paste the following code into the functions.php file, don’t forget to add your Google Analytics tracking code, which you can find under All Accounts/ Account Name/ Tracking Code

<?php
2 add_action('wp_footer''add_googleanalytics');
3 functionadd_googleanalytics() { ?>
4 // Paste your Google Analytics code from Step 6 here
5 <?php } ?>

3. Alternatively, you can install a WordPress plugin which will allow you to see Google analytics within your WordPress CMS. Google Analytics for WordPress is one such plugin. This will simply require you to paste your tracking code and the rest will be taking care of.

Once you’re linked, expect to wait a couple of days before the data starts pouring in. Happy data obsessing!