Set Up Your Google Analytics Account
If you haven’t already done this, you will first have to sign up for Google Analytics:
- Go to Google Analytics. If you haven’t signed up for an account yet, you’ll see a wizard that says “Create an account, start here”. Click that button.
- Enter your account name. In my case, this was “A Site About Emojis”.
- Enter your website name. In my example, this was also “A Site About Emojis”.
- For a lot of people, the account name and the website name will be the same. This might differ if, for example, you’re setting up a company and then that company has multiple domains underneath. In that case, you might have an account name and then multiple website names underneath.
- Enter your website URL. In this example, this was “http://www.asiteaboutemojis.com”.
- Enter your industry category. This doesn’t matter too much, it’s basically just more information for Google.
- Set your time zone.
- Underneath all the fields you have to fill out, you will see a few options Google checks by default. I usually uncheck them, but it probably doesn’t matter all that much either way.
- Click “Get tracking ID”.
- Accept the “Terms and Conditions”.
- You will now reach the section of Google Analytics where they give you your Google Analytics tracking code. If you are setting up the site normally, without Google Tag Manager, you might take this and paste it into theof one of your site templates in WordPress.
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.
Add the Google Analytics Tag to Google Tag Manager
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:
- Creating the Google Analytics tag and tracking ID variable in Google Tag Manager;
- Adding the Google Analytics Universal tag and triggering it in the right pages;
- Submitting all of the changes you have made to your Google Tag Manager container;
So, here it goes:
Creating the Google Analytics Tag and the Tracking ID Variable in Google Tag Manager
- Log into Google Tag Manager.
- On the left hand side, click “Tags”.
- Click “New”.
- Name your tag. You want to think about your naming convention—it will make it much more straightforward and easier to navigate Google Tag Manager in the future, especially if you start to add a lot of tags to it. So, my advice for you is to pick a really clear, easy to follow naming convention.
- In my example, I used the convention “GA” (for Google Analytics) – so my tag’s name was “GA_TrackingCode”.
- Click the little pencil under “Tag Configuration”.
- Click “Universal Analytics”. This is the current version of Google Analytics, so 9 times out of 10 you’re going to be using this one.
- Click on the “Google Analytics Settings” drop-down menu → “New Variable”.
- In the “Tracking ID” field, paste the Tracking ID you saved to a note earlier.
- Click outside of the “Variable Configuration” box.
- Give this variable a name. In my case, this was “GA Tracking Code”.
- Click “Save”.
Creating the Google Tag Manager Trigger for your Tag
- Click the little pencil under “Triggering”.
- Click the “+” sign in the top right hand corner.
- Click the little pencil under “Trigger Configuration” again.
- Click “Page View”.
- Leave “All Page Views” checked.
- Name the trigger. In my case, this was “All Page Views”.
- Click “Save”.
- Click “Save” again.
Publishing your Google Tag Manager Container
- Go back to your Google Tag Manager Workspace.
- (Optional) If you have multiple changes you have made to Google Tag Manager, you can sort by “Last Edited” to see the Google Analytics one.
- In the upper side of the screen, you will also see the number of workspace changes. In my case, it shows “2” because there were 2 workspace changes that had not been submitted yet.
- Click “Submit”.
- Add a Version Name and a Version Description. I usually choose to be quite descriptive here so that in the future, if someone else is working on this, they will know what was changed. In my case, the version name here was “Adding Google Analytics”, and the Version Description was “This update contains Google Analytics installation”.
- Click “Publish”.
Verify the Google Analytics Installation
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.
- Install the Google Tag Assistant Chrome plugin.
- Go to your website.
- Open the Google Tag Assistant plugin.
- Click “Enable”.
- Refresh the page.
- Open the Google Tag Assistant plugin again.
- You will see Google Analytics and Google Tag Manager there.
Alternatively, you can also verify your Google Analytics installation using the following method:
- Go to your website in one Chrome tab.
- Open Google Analytics in a new tab.
- On the left hand side, under “Reports”, click “Real Time” → “Overview”.
- You should be able to see at least your session showing up on Google Analytics.
Creating Google Analytics Views
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:
- Main View – where you do the majority of your analysis, your day to day stuff. This should be working flawlessly, without any kind of problems.
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”.
- Staging view – your testing ground. This is where you run experiments, where you try out new things. You can mess this one up because it’s a staging view, so it’s to be used to test out new settings, filters, or any other configurations before moving them to the “Main View” (once you know they are working as intended)
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”.
And that’s it! I hope that was helpful. That was the exact step by step process you need to follow to install Google Analytics onto a WordPress site / WordPress theme using Google Tag Manager.
Even More Resources
If you’re JUST getting started with digital marketing, take a look at the digital marketing strategy guide or the website analytics guide to develop your own comprehensive tracking strategy.
If you’re ready to take your tracking to the next level, be sure to check out the ClickMinded Google Analytics Training Course.