Get AI SEO for FREE.

Learn More!

How to Self-Host Google Analytics Tracking JS File with Rank Math

In this knowledgebase article, we’re going to walk you through how to self-host the Google Analytics tracking JavaScript file.

How to Self-Host Google Analytics Tracking JS File PRO

1 Enable the Analytics Module

To begin with, ensure that you’ve enabled the Analytics module by navigating to Rank Math SEO → Dashboard as shown below.

Enable Analytics module

2 Connect Your Google Account

The next step is to connect your Google account. If you’re doing this for the very first time, we recommend you read our tutorial on how to install Google Analytics with Rank Math SEO. 

Once you’ve connected Google Analytics, enable the Install analytics code option which you’ll find in Rank Math’s General Settings which are located under Rank Math SEO → General Settings → Analytics, as shown below:

Enable Install Analytics code

Once enabled, the additional options shown above will appear allowing you to choose whether you’d like to anonymize IP addresses, and self-host the Google Analytics tracking JavaScript file.

3 Enable Self-Hosted Analytics JS File Option

Enable the Self-Hosted Analytics JS File option. When enabled, Rank Math will host the Google Analytics tracking file locally (automatically updating the script every 12 hours), which can help accelerate the speed of your website as an external request no longer needs to be made.

Enable Self-hosted Analytics JS file

If you still have any questions about self-hosting your Google Analytics tracking file, please feel free to reach out to our support team who are always more than happy to help.

Still not using Rank Math?

Setup takes less than 5 minutes including the import from your old SEO Plugin!

Learn more about the PRO Version

Still need help?


Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket

Related Articles