How to install Google Analytics on a self-hosted WordPress website

WordPress is one of the most popular content management systems (CMS) and at Twenty3Media we recommend WordPress-based websites for our clients 90% of the time.

With WordPress, it’s easy to manage a website’s content once the design and development work has been done. If you have a self-hosted WordPress website, but don’t have Google Analytics installed yet then this blog post is for you.

A self-hosted website means that you bought a unique domain name (like www.twenty3media.com) and you (or your developer) installed WordPress on the domain.

Please note that the free version of WordPress (where your domain name will look something like www.yourwebsitename.wordpress.com) does not allow users to install Google Analytics tracking code.

Getting started with Google Analytics

To get started, you will need a Google account (click here to sign up for an account). If you have a Gmail address, you’re good to go. Once you have your account, go to the Google Analytics website. You will land on a page looking like this:

 

Click on ‘Sign up’ to create an account. If you’re already signed in to your Google account you will be taken to a landing page. If not, sign in with your Google account’s details.

 

Fill in all the relevant fields, I normally keep all of the ‘recommended’ fields ticked.

Once you click on ‘Get tracking ID’ you will need to accept a Terms of Service agreement. Once you click on ‘I accept’ button, you will be taken to a page where you will see your tracking code. You can copy this code and keep it safe, but it’s not needed for the plug-in that we’re going to use in this tutorial. You will verify your Google Analytics account without the tracking ID – the plug-in will automatically pick up the tracking code if you follow the steps below.

 

In a new window, open your website’s WordPress dashboard and navigate to Plugins > Add new. In the search box, search for ‘Google Analytics Monsterinsights’ and click on ‘Install now.’

 

Once your plug-in is installed, navigate back to ‘Plugins.’ In your list of installed plug-ins, search for the Google Analytics by MonsterInsights plug-in and click on ‘Settings’ underneath the plug-in’s name. You will be taken to a page where you have to authenticate your Google Analytics account for that specific website with your Google Analytics profile. Follow the prompts on the page.

Once you’re done, to check that your tracking code is working, go back to the window where your Google Analytics tracking code is open. Click on ‘Real-time’ in the left-hand menu and then ‘Overview’ in the left-hand column. In a new window, open your website (for instance, www.twenty3media.com) and wait a minute or two. If your tracking code is installed correctly, you will see the number of visitors on your website pop up.

I hope this was helpful. Good luck! 🙂