Hello,
Thank you for reaching out to us regarding installing Google Analytics 4 (GA4) using the Rank Math plugin and cleaning out any old unwanted codes. To install GA4 using Rank Math, please follow these steps:
- Make sure you have the latest version of Rank Math installed. The feature to create and connect with GA4 properties is available from version 1.0.88 onwards.
- In your WordPress dashboard, navigate to Rank Math SEO → General Settings → Analytics.
- Scroll down to the Install Analytics Code section and enable the toggle as shown in the screenshot below:

- After enabling the toggle, you can also configure additional options like anonymizing IP addresses, using a self-hosted analytics JS file, and excluding logged-in users.
- Finally, click on the Save Changes button at the bottom of the page to ensure the changes are saved.
To ensure that Rank Math has successfully added the GA4 code, you can check your website’s page source code for the following format:
gtag('config', 'G-xxxxxxxx', {} );
If you encounter any issues or if the settings are not reflecting after saving changes, consider switching to Google Chrome or another Chromium-based browser.
If you need assistance with cleaning out any old unwanted codes or further help with installing GA4 using Rank Math, please feel free to contact our support team directly here. Our team is available 24×7 to assist you.
Kind Regards,
Rank Math Support Team
Sources:
Making the Most of the Analytics in Rank Math
Using Google Analytics 4 Property With Rank Math Analytics » Rank Math
Resolving Rank Math Analytics Related Issues » Rank Math
Installing Rank Math Plugin with SSH or Terminal » Rank Math
How to Setup Rank Math SEO Plugin Properly
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
You can follow the steps mentioned in this guide to create a GA4 property by using the Rank Math plugin: https://rankmath.com/kb/using-ga4/
Once done, you can share your website URL with us so that we can check this further.
Let us know how it goes. Looking forward to helping you.
Thank you.
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
Our plugin can create the GA4 property, not the GA account. If you don’t have a GA account, you will have to create it manually.
In this case, please visit this page (https://analytics.google.com/analytics/web/) and sign up for a Google Analytics account and property, then reconnect your Google Account so the new Analytics account will reflect in that section.
Please go through this article to connect your Google Account with Rank Math properly: https://rankmath.com/kb/connect-your-google-account/
Hope that helps.
Please don’t hesitate to let us know if you have any other questions.
Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.