Alex Williams
Alex Williams  —

Last updated:

Share this Post

analyticsOne of the first things anybody does when building their business, either as a solo freelancer or even an SME, is to set up a website.

This functions not only as a landing page that hooks the customer but also as a way to show off what products and services they offer. 

To that end, most consumers tend to go for WordPress, and the numbers certainly bear that out. In fact, WordPress runs 75 million websites across the internet and accounts for a little over 30% of all websites. That’s a mind-boggling number and a testament to how excellent the platform is for those who want to create websites.

Of course, one thing that may have gotten lost in the frey of setting up a website is getting yourself some Google Analytics. If you don’t know what that is, well it’s essentially a metrics dashboard that analysis all traffic related to a specific website.

It’s an incredibly useful tool in a myriad of ways, and today we’re going to take a look at how to get it for your WordPress site.

Table of Contents:


The Advantage of Google Analytics

The truth is, the whole world runs on data, especially eCommerce platforms. Many popular apps and services exist solely on using data to optimize their service, and there are some specific advantages to having Google Analytics.

Understanding Your Audience

All sites tend to have a target audience, but just as important, you should know what audience tends to visit your site. Not only does that give you a good idea if your marketing and outreach are hitting their targets, but also gives you an idea of where you should put your efforts.

It also lets you know how visitors actually reach your site. After all, you could have a presence on social media, on LinkedIn, or maybe you just have great word of mouth! Google Analytics can tell you where visitors come from, and even if you find that most people come from google searches, then you know that your SEO is doing its job. 

Following from there, Google Analytics lets you track what your visitors do once they are on your website. This can help you figure out what kind of content seems to work better for what audience, and if there are certain types of content that might not be worth the resources. 

So as you can see, Google Analytics will help you with everything, from your content strategy, to your UI/UX, and generally, give you a sense in terms of how you are hitting your targets. Regardless of what WordPress host you go with, adding Google Analytics is going to help you along with any other tools your host provides.


Setting Up a Google Analytics Account

account iconThe first thing you need to get Google Analytics on your site is to have an account for it. Thankfully, it’s a pretty easy setup and you can open an account by going to the Google Analytics page and clicking on sign-up.

At this point, you’ll be asked to use a Gmail account. If you already have one made specifically for this website, then great! Put that in here. Otherwise, you can go ahead and create a new Gmail account by clicking on ‘Create Account.

After you’ve signed in or created a Gmail account, you can get to Google Analytics by pressing the ‘Start measuring’ button. Once you do that, you’ll be prompted to enter a name for the account, as well as a variety of settings and information to fill in.

For starters, you’ll see a lot of data sharing settings, you’ll want to turn all those on. After that, you’ll have to enter the actual details of your website that you want to measure and what they call ‘Property Details’. 

Once you’ve inserted that info, click on ‘Show Advanced Options’ and toggle ‘Create a Universal Analytics property’. This gives you access to other tracking platforms and provides a more holistic picture of your metrics. Once you do that, click on ‘Next’.

Here you’ll be prompted to put in some information about your business and the purpose of using Google Analytics. Ironically enough, this bit is for Google’s own Analytics. Again, once you’re done click on ‘Create’. This should give you a pop-up asking you to agree to terms and conditions. 

Once you’ve read through the terms of the agreement, you’ll be directed to a screen with your tracking ID, which you’ll use for your WordPress site.

Aaaaaaand you’re done! Well, done creating a Google Analytics account, the next step is actually adding it to your site.


Adding Google Analytics to your WordPress Site

wordpress logoGenerally speaking, there are two ways to get Google Analytics on your site: Manually or with a plugin.

We suggest using a plugin since adding it manually requires a bit of technical knowledge, although it’s relatively easy. Nonetheless, we’ll include both techniques in this guide.

Manually Adding Google Analytics to Your WordPress Site

First, you’ll need the Google Analytics tracking code, which you can find in the dashboard of the account you just made. It should be under the name of the site you set it up for by going to the ‘admin’ on the left sidebar, then in the property click on ‘Tracking Data’ > ‘Tracking Code’.

In the website tracking area, you’ll see a script, take all of it, and copy it, that’s going to go into your WordPress site.

You do that by going to the WordPress dashboard, and then find and click on ‘Appearance’ and then ‘Theme Editor’. On the new page, you’ll find a list of Theme Files on the right-hand side, scroll down until you find one that says ‘Theme Header (header.php)’.

Once that opens up the theme header script in the main window, you’ll want to paste that code you got from Google Analytics right before the end of the header that looks like </head>.

Once you do that, click ‘Update File’ and you’re done!

Adding Google Analytics to Your WordPress Site using a Plugin

There are actually a few plugins that work in this situation, and you’ll be happy to know that Google themselves make one called ‘Site Kit by Google’. 

First, install and activate the plugin, then click on ‘Start Setup’, which basically starts a process wherein you connect your WordPress site to your Google Analytics site. There will be a few verification steps to get through to make sure you are who you say you are, but for the most part, it’s relatively straightforward.

Once the setup is complete, you’ll have the Google Site Kit panel on your dashboard, and it will allow you to see all the analytics associated with your site, including external third-party metrics.


Conclusion

As you can see, adding Google Analytics is much easier through a plugin, although the script method should work on most blogging platforms. Either way, once you unlock the patterns of information provided through Google Analytics, you can make better decisions when it comes to how you run your site.