How To Install Google Analytics On WordPress

Why Google Analytics Is Important

With WP now powering almost 30% of the web and Google’s platform taking 86% of the analytics market, it’s a safe bet to assume that many people are looking to install Google Analytics on WordPress. And getting set-up with analytics is essential. With web analytics you will begin to understand who visits, your site, where they come from and what they are interested in.

This is a great way to begin to understand who your core audience is and more to the point, what they really want.

There are many different analytics packages out there but the great thing about Google’s offering is that it’s free(they get your data too, so maybe not so free) and there is a wealth of training available from Google too.

I should point out that the open source project Piwik has come along way and can be implemented at a relatively low cost.​

​Who Visits Your Site

Google’s offering allows any Irish business to break down their visitors by huge array of different factors including things like browser, screen size, language and many more.

But for local Dublin based businesses, maybe the most important factors are device and geo-location.

By segmenting your visitors using this information you can find out if people are finding your site on the go or at home. And just how local your business is.​

What They Do On Your Site

You can take a look at what pages, products or services are the most interesting and then focus on promoting these more.

You can also get a better understanding of pages that cause a visitor to ‘bounce’ back and use this data to change the content to keep the user’s attention.​

Where Your Visitors Came From

This is essential to understanding how your Irish based audience finds your site. Is it through an out bound email campaign or via pay per click ads. 

You can judge if the money you are spending on an SEO campaign is working or not and adjust your budgets accordingly.​

Google gives you the breakdown of each of the referral sources so that you can better allocate your advertising budget.

And installing Google Analytics’s is a breeze.​

Installing Google Analytics on WordPress

No doubt that you have a Gmail account already, so just head over to the Google Analytics Sign Up page and log in as you would with your email account.

​After that, you will be asked to sign up and start using GA. Just click through to the next screen.


The next screen gives you the option of a website or a mobile app. Make sure you click the website option. There used to be an option for ‘Classic’ or ‘Universal’ analytics but ‘Universal Analytics’ is now the standard.

​The rest of the info is pretty straight forward stuff and if you ever filled in an online form before there should be nothing to worry about.

At this point you’ll get your website tracing code which will look like the picture below. You should copy and paste the UA number to a notepad depending on how you want to install it on your site.​


Install Analytics On WordPress

There are several ways to install the tracking code on your site and each has it’s benefits and drawbacks. Going the route of plugins does make things easier but of course, plugins are sometimes poorly coded and can leave your site open to attack.

Plugins, The Easier Way

There are several plugins that can be used. Basically all you need to do is insert the code in the header or footer and a quick search of the WordPress plugin in directory shows tens of possible plugins. Insert Headers And Footers is reasonably well known one but if you are going to use Google Tag Manager too, then DuracellTomi’s Google Tag Manager for WordPress is the better option.

Once installed, just copy the Google tracking code into the plugins settings page and your done.

Editing The Theme Files

You can go into your Wordpress theme and directly add the code to your header.php file but I wouldn’t recommend doing that unless you really understand WordPress Themes and have some level of coding experience.

It’s Installed, Now What?

Well that’s it. I suggest going back to the Google Analytics web app and getting to grips with the layout and how it all works. 


About the Author

Foley has been helping businesses increase their revenue and boost their online presence for 4 years. He enjoys jogging, beer and tinkering with the web.