Setting Up Google Analytics in WordPress – Without #KoalaRage

Yesterday I had the pleasure of visiting The Apprentice Academy in Manchester to talk about Google Analytics and WordPress, among other digital marketing topics. So today I wanted to share with you some of the things that I do to ensure I get the most from Google Analytics when using a WordPress website.
Now, none of us want #KoalaRage (ask @PamWheelerUK about that) – we all know it can cause great stress to figure out Google Analytics and so I want to ensure you are fully set up in WordPress to ease the burden and prevent your inner Koala appearing.

The below is based on the assumption that you have already set up your Google Analytics account, if you haven’t do so here – you don’t need to install the code just yet. Who needs the hassle of messing in HTML code, far too much risk in that!

Installing Google Analytics to WordPress

Step 1. Install Yoast Google Analytics Plugin

Once activated simply enter your UA-xxxx code manually or you can click to authorize and select the correct website to track.

Step 2. Check the Settings

With this plugin there are a series of settings to check, here is a run down of what should be ticked and why…

Track outbound clicks and downloads
This adds events to any link outside of your domain, or which is a resource (eg .doc or .pdf files)

Allow Tracking of Anonymous Data
This allows Yoast to collect data from your site anonymously to further enhance their plugins and keep them free!

Universal Tab: Both should be ticked
This will ensure you get the most amount of data possible from your Google Analytics reports.

Advanced Tab: Setting Path for Internal URLs to view as external
For SEOAndy this is /go/ as I use an internal link shortening service, if you don’t then don’t worry.

Step 3. Check You are Tracking

In your Google Analytics account, go to Admin, and under Property click Tracking Info and then Tracking Code. You should then see the status at the top of your page similar to the example below.

Note: it can take upto 24 hours for this Status to change.

If you are having problems after this time, check this Google Help page for more info.

Step 4. Wait a few days or weeks

We all want a quick idea of when something is working or not, however Google Analytics is typically at least 24 hours behind in reports and even that data early on can be unreliable. This means that you will need to give it a few days before you can start looking at the data and getting anything of value from it.

The good news is that tomorrow’s article is about finding the valuable and key bits of information from Google Analytics – the bits every manager wants to know.

The issue with using the theme is that you can’t be sure how it is implementing, nor do you get the features such as outbound tracking in 99% of cases. I would always use a plugin such as this which you also know will be updated and is flexible to track.
I found it annoying recently using a theme to do this when a site had been tracking in Universal Analytics and was suddenly tracking using the Classic code – which mean that it was not collecting all of the data points again.

Using other CMS’s there are other plugins – I will update the post later with the one i use for Magento. But in most cases a manual input is better if you know which bits of code to add and why (for tracking) – however the reality is that unless you are a developer you can’t do things like automatically append event tracking codes to external links or downloads. That is great functionality and you can get it without fuss using this plugin 🙂

That’s good to know Andy. I used Genesis for a long time and it was easy to add the GA code into the header sections, and then I swapped themes and completely forgot about GA for 2 months and then wondered where my traffic went!

Oh, and there in is another reason to sue a plugin – swapping themes doesn’t break it (though you may need to reset it in some cases by deactivating and reactivating – thats mainly on ecommerce sites though)

And if by some odd chance you’d have several sites/ID’s under one account (who would do that??) be careful when you copy-paste the code so as not to accidentally put one and the same code on two different sites (whaat? no way, no one would be that stupid??). Yeah. Well. Just be careful

Hey Helina!Surprisingly more common than you would think 🙂
I usually find it best to simply have a separate account for each domain, you then just need to be careful of your subdomain. – but as you say, be careful