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

Disclosure: Your support keeps the site running! We may earn a referral fee for some of the recommended services on this page. These are services we have tried or use. Learn more.

Do you want to install the new Google Global Site Tag (gtag.js) in WordPress, but are having a hard time on where to start from? Well, you are not the only one.

Upgrading your website’s Analytics.js (ga.js) tracking code to the new Google Global Site Tag (gtag.js) code snippet. Is the perfect step to take at this time. Because the gtag.js snippet is now the recommended Analytics tracking system.

So in this article, we will look at how to configure global site tag (gtag.js) in WordPress using MonsterInsights. Of course, without getting your hands dirty. But first;

What is Global Site Tag?

The new Google global site tag (gtag.js). Is a JavaScript library that provides better dynamic integration with Google marketing platforms, than it’s predecessor analytics.js (ga.js). Which was mainly for Google Analytics only.

Global Site Tag allows the transfer of website user events data to Google Ads, Analytics and other platforms.

The trackable events in gtag.js are, link clicks, custom dimensions, refunds, purchases, add-to-cart, checkout, etc. And it further provides deep insights about your website user behavior.

Install gtag.js in WordPress

Although, Google usually maintains a backward compatibility on its products. All new Analytics accounts, have no choice but to use or migrate to gtag.js snippet.

This allows you to fully take advantage of the new tracking features and integration in gtag.js.

To quickly configure global site tag on your website. Download and install the MonsterInsights Analytics plugin for WordPress. The plugin integrates your website with Google Analytics without touching code. Get MonsterInsights for free.

The configuration process is automatic. Just install, activate and connect MonsterInsights plugin with your Google Analytics account.

Prior to plugin activation, make sure to remove any custom Analytics code or plugin on your site.

MonsterInsights offers Global Site Tag support by default to new users. Existing users have an option to switch to the new gtag.js or stick with analytics.js until the next plugin update.

But if you would rather take a crack at it manually. This developer resource describes how to manually migrate from analytics.js to gtag.js.

Or go with MonsterInsights which gives you Global Site Tag tracking code by default. Plus, it brings in all the Google Analytics data right within your WordPress dashboard.

And that’s it. But as you can see, without plugins like MonsterInsights. Setting up Analytics with your website can be a real pain.

I hope you found this article useful in configuring your gtag.js tracking code in WordPress. Got some questions? Start that conversation with me in the comments below.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.