The Ins and Outs of WordPress and Google Analytics

WordPress analytics

Google Analytics is a free tracking tool that gives you detailed reports of how users behave on your website: where are they from, from what devices they browse, how they scroll or interact with different elements of your site (videos, carousels, buttons, etc.).

Most of all, by using Google Analytics you’ll understand which marketing channels are bringing you the most value, or which ones are leaking you money.

The Google Analytics reports are a goldmine if you know how to draw insights from them. 

And it’s totally FREE!

So, let’s start with creating your Google Analytics account, here.


How to set up your Google Analytics account

Now, when you’re reading stuff on Google Analytics, you’ll find out about its two versions:

  • Universal Analytics (UA)
  • Google Analytics 4 (GA4) – the recent default Google Analytics.

Universal Analytics is very much web-focused, while Google Analytics 4 can provide cross-platform data (mobile + web). This is the main difference, but not the only one. I’m not going into detail right now, because this is not the purpose of this article.

Some experts out there consider that you should install both of them on your site because GA4 is not mature enough to be used as a standalone web tracking platform. 

In this article, I’ll just go through setting up Google Universal Analytics very fast (the GA4 setup is similar).

So, after creating your Google Analytics account, log in and:

Set up a Google Analytics property

A property represents your website or app and is the collection point in Analytics for the data from your site or app.

  1. From the Admin level, select your desired account (if you have more than one);Select Analytics account
  2. Head over to the “Property column, and select “Create Property”;Create Analytics property
  3. Name your new property, eg: the website’s name.
  4. Select the currency and time zone. Future changes of the time zone don’t work retroactively;
  5. From the “Advanced Settings” toggle on “Create a Universal Analytics property”;Create Universal Analytics property
  6. Type in your website URL;
  7. Tick the option that creates both GA4 and UA properties. They will have different ids. If you named your property “My Website”, your Universal Analytics property will be named “My Website (UA-1234567)” and your Google Analytics 4 property will be named “My Website – GA4 (98765432)”;
  8. Select “Next”;
  9. Provide the required information about your business;Info about the business

Now, you’re done! 

Set up a reporting view in your Google Analytics property

Views allow you to filter your data, maybe you want to have a different view for your site and blog, or you want to filter out employees’ IPs. 

  1. The admin view has three columns: account, property, and view. In the view column select “Create view”;Create Analytics view
  2. Select either Website or Mobile App;
  3. Name your view and select the time zone;
  4. Save your view by clicking on “Create view”;Create view
  5. Now you’re back to the admin area and it’s time to select your view for making additional settings.Additional view settings
  6. Name your view; 
  7. Type in the website URL;
  8. Select the time zone country or territory: this will affect the hour and day for which you’ll see the reporting; 
  9. Make sure to exclude bot traffic.Exclude bot traffic
  10. Set up “Site Search”. If you enable site search you will be able to track what people are looking for on your site.
  11. Save your view.

Now that you’ve set up Google Analytics, it still does not track your site, they are not yet connected. We will need to place a tracking code on your site that will allow Google Analytics to collect data.


Add the tracking code to your WordPress website

Now there are two main ways for doing this: via a developer or Google Tag Manager.

In Google Analytics, the tracking code is found at the property level, Tracking info -> Tracking Code.Tracking code

Global site tag

As mentioned above, in the instructions, you can send this code to a developer to place the code (script), as the first item into the <HEAD> of every webpage you want to track. He’ll know how this gets done.

But, I like to do this via the Google Tag Manager. Let’s find out how. 


How to deploy Google Analytics on your WordPress website using Google Tag Manager

Google Tag Manager (GTM) is a free tag management system (TMS) developed by Google. It allows you to manage and update different types of tags on your website. A tag is a Javascript tracking code or snippet that allows you to track user behavior on your website and send this information to a third party. 

Let’s say you want to run some Facebook ads. You will need to use the Facebook tag on your site in order to let Facebook when conversions are happening due to your campaign.  The same goes for Google Ads, Twitter Ads, Quora Ads, and so on.

But tagging doesn’t only happen for ads. You can even add the Google Analytics tag, or maybe the Mouseflow tag (which allows you to understand how users click and scroll on your site).

Now, these tags can be deployed manually, by your developers, inside your website’s code. But that wouldn’t be too wise. If they are too many, you might lose track of them, or install them twice..and it’s not quite a scalable process.

That’s why Google Tag Manager comes to the rescue. It allows you to deploy different types of tracking codes (tags) without needing to edit your website’s code. 

Another cool thing is that it’s very easy to make changes to these tags, and you can even have a history of your changes. And if you run multiple websites, you can have an account for each of them. Your life just got easier. Some tags are so easy to deploy that anyone can do this, but usually, the folks inside your marketing team would be in charge. For more advanced tags, such as events or conversions, they might still need a developer around.


So, let’s start from ground 0: sign up for Google Tag Manager. 

  • Once you’re logged in, click the “Create Account” button.Create new Google Tag Manager account
  • Now it’s time to name your account and select the country. You can use your website’s name.
  • In the Container Setup step, type in your website’s name, then choose your platform: app or website (depending on what you need to track).GTM container setup
  • Hit “Create”.

After agreeing to the Terms and Conditions you’ll be prompted with two…tags, as you might have guessed, which needs to be deployed on your site, onto the header.php and body of your WordPress site to be more precise.

Install Google Tag Manager

Just head over to a developer to help you out with this


deploy it via the Google Tag Manager for WordPress plugin.


When this is done, you can create your first tag inside the Google Tag Manager!

How are you hanging on? Blink twice if you’re still with me :).

Now, let’s create our Google Analytics tag!

  1. Head over to “Add a new tag”.Add new tag in GTM
  2. Give your tag a name, eg: Universal Google Analytics.Name your tag
  3. Click on “Tag Configuration”, then choose the “Google Analytics: Universal Analytics” tag. It’s nice that there are lots of predefined tags in GTM.Choose the tag type
  4. In this setup, click on the dropdown menu under Google Analytics Settings and select “New Variable”.Setting up a variable in GTM
  5. Name your variable, then paste here the Google Analytics ID. The ID is the one you find at the property level of your Analytics account -> Tracking Info -> then tracking code, as shown below.Tracking ID
  6. Going back to the tag setup, from the Triggering level, select “All Pages”. This means that this tag will be triggered whenever a page is seen. Setting up a trigger in GTM
  7. Save your tag from the “Save” button in the upper right corner.
  8. Submit your change to GTM.

And you’re done! Google Analytics is deployed on your site. From this moment on you’ll be seeing traffic data in your account.

Now, if you want to learn more about how to use Google Analytics and Google Tag Manager, here is my favorite resource: the Measure School Youtube channel.

This process can be repeated for other tags as well. But things can get a bit more complicated than this when you want to track specific purchases on a site, or video plays, or button clicks, etc.


How to deploy Google Analytics on your WordPress website using plugins

So, by now you’ve found out how to deploy the Google Analytics tracking code on your site using:

  • Manual installation via a developer
  • Google Tag Manager

But there’s a third way!

Enter WordPress plugins…or, enter Monster Insights!

One piece of advice though…choose one method, if you try to deploy Google Analytics multiple times, you will get skewed results.

With over 3.000.000 users, Monster Insights is the best Google Analytics Plugin for WordPress.

After the plugin is activated, you’ll be guided to the setup. It’s pretty straightforward.

  1. Select “Launch the wizard”.Setup wizard for MonsterInsights
  2. Choose the category that best describes your category
  3. Connect Monster Insights and Google Analytics, and give the plugin the needed permissions to access the account.Connect Analytics with monsterInsights
  4. Choose your desired Analytics property that you want to connect.
  5. When the connection is done, you’ll be taken to the final steps of the setup process. You’ll be prompted for the recommended settings for the Google Analytics plugin. Monster Insight allows you to track: 
    1. Events tracking (default);
    2. Enhanced Link Attribution (default);
    3. File Download Tracking;
  6. Next, you can adjust the following settings:
    1. Affiliate Link Tracking;
    2. Access to MonsterInsights’s Reports;
    3. Automatic Plugin Updates
  7. When you’re done with these settings, just click “Done”;
  8. Next, you’ll get some add-on recommendations:Recommended add-ons

This is optional. 

These are the final steps. Just save and you’re done.

Now, it will take a few hours for Google Analytics to send you data.

The moment everything is set up, you’ll be able to see some reports straight in your WordPress dashboard.

For more detailed reports, just go to Insights -> Reports menu from your WordPress dashboard. Set up website analytics

Now, I’d like to present another useful tool that can help you connect multiple Google products to your WordPress website: Google Site Kit. This won’t deploy Analytics!

Here are the Google products that you can connect to your WordPress website:

  • Google Analytics – Google Site Kit allows you to see Analytics reports inside your WordPress dashboard;
  • Google Tag Manager;
  • Search Console – it gives you an insight on how your website performs organically and how is your indexing;
  • AdSense – this tool is one of the most successful ones that allow you to monetize your WordPress website using ads;
  • PageSpeed Insights – this tool enables you to test your overall website performance; 
  • Google Optimize – a tool that allows you to test out various variants of your site without any coding knowledge. 

Now, this tool is very useful when you’re using multiple Google products.


Aaaand, we can call it a day!

If you liked this article, and you want to learn more about how to design a WordPress website, make sure to subscribe to Colibri’s Youtube channel and follow us on Twitter and Facebook!


+ posts

Alina is a digital marketer with a passion for web design. When she's not strategizing she's doing photography, listening to podcasts on history and psychology, and playing with her 2 dogs and cat.


How to Kickstart Your Wordpress Website with No Coding Skills

[Marketing plan included]