implement Google Analytics with Google Tag Manager

How to Implement Google Analytics with Google Tag Manager

Looking for an easy way to update your Google Analytics code on your website?

Google Tag Manager is a free tool that allows you to effortlessly add and update your Google Analytics code and other tags on your site without having to manually write a single line of code.

In this article, we’ll show you the Google Tag Manager setup with Google Analytics.

What is Google Tag Manager and Why Do You Need It?

Google Tag Manager Tool

MonsterInsights is the best WordPress Analytics plugin. Get it for free!

Google Tag Manager is a free tag management system (TMS) offered by Google. It provides a simple platform for managing and updating different types of tags on your website.

A tag is a tracking code or snippet of Javascript that sends information about your site to a third party, such as Google.

Using Google Tag Manager, you can deploy different types of tracking codes (tags) such as the Google Analytics tracking code on your site without needing to edit your website’s code. Similarly, you can add codes for event tracking, conversion tracking, remarketing, and more using the Tag Manager.

For instance, if you want to track file downloads on your site, you’ll have to enable event tracking and manually update all the download links for it to work. But, if you’ve installed the Google Tag Manager on your site, you can simply add a new tag into your Tag Manager to set up file download tracking.

With Google Tag Manager, you can deploy various types of tracking code on your site, including Google Analytics.

An Alternative Method to Tag Manager

The downside to using Tag Manager to deploy tracking codes is that there’s a steep learning curve if you’ve never used it before.

The MonsterInsights plugin is the better choice if you’re after an easier alternative to set up Google Analytics in WordPress.

monsterinsights best google analytics plugin for wordpress

MonsterInsights is the best Google Analytics plugin for WordPress websites. It allows you to set up Google Analytics in WordPress easily, right from your WordPress dashboard. Because of this, you won’t have to log into any third-party sites or mess with endless tracking codes.

The MonsterInsights plugin makes it simple to set up Google Analytics, whether you’re an absolute beginner or a seasoned professional. The core plugin comes with every essential feature you’ll need for your site, including an analytics dashboard so you can view your analytics reports directly in WordPress.

monsterinsights overview report

You can also extend and enhance the functionality of MonsterInsights by installing addons, including:

…and much more. In short, the MonsterInsights plugin makes it super easy, super-fast, and super efficient to use Google Analytics in WordPress.

However, if you still prefer using Google Tag Manager, you can follow the tutorial below to get started.

Implementing Google Analytics with Google Tag Manager

The first thing you need to do is sign up for Google Tag Manager. You can use an existing Google account or create a new one.

Once you’re logged in, click the Create Account button.

create account

Then, enter a preferred account name to your Account Name field.

account setup

In the Container Setup step, you can enter your website name as the Container name. Under Target platform, choose Web and then, click Create.

container setup

Now you’ll be asked to agree to the Terms of Services for Google Tag Manager. Click Yes and also make sure to check the box at the bottom that says I also accept the Data Processing Terms as required by GDPR.

terms of service google tag manager

Then you’ll be given a tracking code snippet that you’ll have to enter onto your site. There are different ways you can paste the code onto the header.php of your WordPress site.

For more details, follow our guide on how to install Google Tag Manager in WordPress.

code for google tag manager

After you’ve successfully entered the code snipet on your website, you will have to set up a tag. Start by clicking New Tag.

click new tag

You can rename the tag by clicking on the Untitled Tag field. Then click on the big icon where it says choose a tag type to begin setup.

choose a tag to begin setup

Then select Google Analytics: Universal Analytics.

select universal analytics

Next, click on the dropdown menu under Google Analytics Settings and select a New Variable.

select a new variable

After that, give a name to your variable and then enter your Google Analytics Tracking ID. There are more settings you can choose from, but you can leave them as it is for now. Click Save when you’re done.

enter google analytics tracking id

In the next step, you’ll have to set up a trigger. To do that, click on the big icon where it says choose a trigger to make this tag fire.

create a trigger

For basic Google Analytics implementation, select All Pages.

select pageviews trigger

Now simply click the Save button at the top and you’re ready to publish your Google Analytics tag.

save google analytics tag

Next, you’ll have to submit your newly created tag. To do that, select Tags from the options on your left. Then select the Google Analytics tag and click the Submit button.

submit google analytics tag

That’s it!

You’ve successfully implemented Google Analytics with Google Tag Manager. Your Google Analytics tag will execute on every page.

After that, you’ll need to wait a few hours for Google Analytics to gather your website’s data. Then, you can log into your Google Analytics account and view your website’s reports.

We hope this tutorial helped you to implement Google Analytics with Google Tag Manager successfully.

If you’re looking for an easier way to implement Google Analytics on your WordPress site, check our article on how to define user permissions in Google Analytics.

And don’t forget to follow us on Twitter and Facebook for more helpful Google Analytics tips.

Want to Try MonsterInsights for Free?

Enter the URL of Your WordPress website to install MonsterInsights Lite.

Comments

    1. Hi Vincent, thanks for stopping by the blog 🙂 If you’re implementing Google Analytics via MonsterInsights, there’s no need to do it with Google Tag Manager as well. In fact, implementing Google Analytics with both MonsterInsights and Google Tag Manager can skew your stats, since the tracking code will be on your site twice.

      However, if you’re using MonsterInsights, you can still use Google Tag Manager to implement other code (besides Google Analytics) without any issues.

      Hope that answers your question! Feel free to get in touch with support if you need more details.

  1. Hi, I’m using the Monsterinsights plugin on WordPress – I presume the same applies – if I’ve installed and activated the plugin I don’t need to add my gtag / gcode to the site – Insights takes care of that right?

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.