Checkout the best WordPress Black Friday Deals

How to Install Google Analytics Global Site Tag in WordPress (gtag.js)

What is Global Site Tag (gtag.js)

Google has now introduced a new JavaScript tagging framework called Global Site Tag (gtag.js) for its Google Analytics platform to replace the old analytics.js system. This new tracking framework tracks data and shares it with all of your Google marketing tools like Google Analytics, Google Ads, and Google Marketing Platform using just one snippet of code.

So, you don’t need to add different code snippets to your website for each of the tools that you use from Google.

Why is it important

One of the main reasons why this is important is that – you can get a better understanding of your audience (insights and behavior) without having to worry about connecting multiple services and adding multiple JavaScript code snippets to your website’s header. This can save you a lot of time, reduce the chances of duplicating data, make your data more reliable, and make your website faster to load for visitors.

How to install Global Site Tag (gtag.js) in WordPress

There are multiple ways to set up Google Analytics Global Site Tag on your WordPress site. But, the easiest and simplest way to do that would be by using MonsterInsights. MonsterInsights is a simple yet powerful Google Analytics plugin for WordPress. It allows you to set up Google Analytics on your WordPress site from scratch and customize it to suit your needs.

From setting up scroll depth tracking on your website to tracking custom events and enabling enhanced eCommerce for WooCommerce, MonsterInsights can help you with everything related to Google Analytics and integrating it with WordPress.

If you haven’t got MonsterInsights installed and configured on your WordPress site yet, you can just install the latest version of the plugin from the WordPress plugin repository to take advantage of the latest code snippet. They’ve already done the heavy lifting for you. Just grab the latest version.

But, if you are an existing MonsterInsights user, you can switch to the latest Global Site Tag from within MonsterInsights Settings page.

upgrade to global site tag in monsterinsights

By just turning on the above toggle, your code will automatically be migrated to the new Google Analytics Global Site Tag. If you have got any custom code or event running on your WordPress site, you needn’t worry about updating them. MonsterInsights will automatically detect those analytics.js events and pass them through the Global Site Tag (gtag.js). How simple!

But if you don’t mind waiting or if you feel that you don’t want to take the risk now, you can wait until they update the plugin to make use of Global Site Tag as the default option. Don’t worry though, this shouldn’t take long. Once the latest version is released, you’ll be able to use the new tracking snippet automatically and the above option will most probably be removed from the available option.

So, what are you waiting for? Go ahead and get MonsterInsights right away!

If you have got any doubts, you can check out my detailed MonsterInsights review. Or, just leave your question in the comments section below. I’d be happy to answer them for you.

P.S. If you don’t need all the features that MonsterInsights Pro offers, you can go with the Lite version. By the way, the Pro version comes with a 14 days money-back guarantee. 😉

Leave a Comment