There are two main reasons why you’d want to install Google Analytics tracking onto a WordPress site using Google Tag Manager:
In this blog post, I’ll go through the exact step by step process you need to follow to install Google Analytics onto a WordPress site / WordPress theme using Google Tag Manager.
Let’s get going.
Adding Google Analytics to a WordPress website will take about 15 to 30 minutes, and here’s the high level overview of how to get this done:
If you haven’t already done this, you will first have to sign up for Google Analytics:
However, there’s a simpler way to do this, I’m going to show you how to do this through Google Tag Manager. So, instead of copying the Google Analytics code, copy the “Tracking ID” at the top of the screen – take that and paste it into a note.
Now that you’ve set up Google Analytics and copied your Google Analytics ID, head over to Google Tag Manager. Remember, if you haven’t set this up yet, you can check out our Google Tag Manager tutorial.
To properly setup Google Analytics using Google Tag Manager, you will have to go through three main steps:
So, here it goes:
Now that you have set up Google Analytics and added it to your Google Tag Manager, you will want to make sure it’s actually working.
Alternatively, you can also verify your Google Analytics installation using the following method:
Once you have properly installed Google Analytics and checked that it’s working, there are some basic good practices you should setup straight away to make sure you future-proof your account.
One of them is setting up multiple Google Analytics Views.
If you go to your Google Analytics Admin, you will see three different columns there: your Account, your Property, and your View.
By default, Google Analytics will set up only 1 view named “All Website Data”. Having only this view will still allow you to take advantage of everything Google Analytics has to offer. However, this is not a good practice since you might start getting more advanced with Google Analytics in the future and start adding filters or other data processing settings to this view. In that case, you will not have a way to recover the unprocessed Google Analytics data.
Setting up at least these 3 different views will allow you to safely apply and test new settings on your view while minimizing any data-loss risks:
a) You can just rename the Google Analytics default “All Website Data” for this purpose.
b) To rename it, click on it → “View Settings”.
c) Under “View Name”, enter “Main View” – this will help you keep things clean and organized in your Google Analytics.
d) Click “Save”.
a) Under the “View” column in your Google Analytics Admin Panel, click “All Website Data”.
b) Click “View Settings”.
c) Click “Copy View” (top right hand side of the screen).
d) Enter “New view name”: “Staging View”.
e) Click “Copy view”.