WordPress plugin · MonsterInsights family
MonsterInsights – Performance Addon
Host gtag.js locally and set Google Analytics sample rates and site speed sample rates.
About This Plugin
The MonsterInsights Performance add-on adjusts how Google Analytics runs on your site. It can host the Google Analytics script gtag.js on your own domain. That means faster page loading, increased web vital scores, and the ability to bypass ad blockers to improve tracking accuracy. MonsterInsights automatically updates the latest version of the script and pushes it to your website.
It also lets you change your overall sample rate and customize your site speed sample rates. If your site is busy, you can throttle how many hits go to Universal Analytics properties in Google Analytics. No coding is needed. The add-on works with Google Analytics 4.