Everyone knows Google Analytics tracks and reports website traffic. If you have your own website then you definitely know how to set up Google Analytics. It needs some kind of script that is a Global Site Tag (gtag.js) to add to your website.

Running different kinds of scripts on a website might slow down its loading speed one of them is gtag.js.

Since everyone has added Google Analytics tracking script to their website. So you might be asking yourself how to overcome this issue as we have an Analytics script already added to our website.

Well, MonsterInsights has found the way to host your gtag.js on your own local server.

Thanks to MonsterInsights 7.18 that comes with an update to host the Google Analytics gtag.js script locally.

MonsterInsights is the WordPress plugin I’m using for Google Analytics across my whole website and to give me many more features that are valuable like tracking forum submissions and even affiliate links.

If you’ve got blog posts for example that are then driving people over to the shop and leading to something being purchased. It’s very important for these to be known that way I’m able to see which of my posts on my website are truly valuable, what I should make more of, what posts I am getting actual sales from and where those sales are coming from.

This analytics plugin is very powerful and makes everything easy which is why I started using it.

Why do you need to host gtag.js locally?

Well, the Google Analytics tracking script might slow down your website. Since Google has committed the Core Web Vitals as the important ranking factor. Those websites that loads faster can appear in the top of the search result.

Performance Addon fetches the latest gtag.js from Google every 24 hours.
Google Analytics has a 2 hour cache time by default. You have full control over the caching of the file which reduces loading speed.

How to host gtag.js locally with MonsterInsights.

MonsterInsights is the most powerful analytics plugin for WordPress. If you don’t know how to set up the plugin you can check it out here.

Hosting gtag.js locally needs a Performance Addon so you have to purchase the Pro version of MonesterInsights.

  • After purchasing of MonsterInsights Pro download the latest version of it.
  • Go to your website dashboard and add a new plugin.
    After installing the plugin activate it.
  • In the General Tab put your license key for the Pro version.

If you don’t know how to setup MonsterInsights plugin you can check it out here.

    • Finally after setting it up make sure Add Gtag.js File Locally is enabled under Performance Tab to your website to host gtag.js locally.

MonsterInsights host gtag js file locally.jpg

Performance Addon of MonsterInsights will really help you to reduce the loading time of your website.

With the help of MonsterInsights, you can track your website performance in the WordPress dashboard with any kind of issue.

It is just more than a plugin that tracks everything even affiliate links.

Get MonsterInsights Pro Plugin Now