Host Google Analytics locally
CAOS Pro is an analytics optimization plugin for WordPress that lets you host the Google Analytics gtag.js file locally. It downloads and saves the file to your website’s server, then keeps it updated through WordPress’ built-in Cron schedule. This provides a set-and-forget workflow for sites using Google Analytics 4.
After you enter your Measurement ID, CAOS can add the necessary Google Analytics 4 tracking code to the header or footer of your theme. You can also add the code manually. The locally hosted file may be saved anywhere within the WordPress wp-content directory, and it can be served from your CDN.
Analytics options and performance workflow
CAOS Pro supports Minimal Analytics 4, described in the source as a lightweight alternative to Google Analytics’ default libraries. This option is intended for site owners who want basic pageview-focused analytics without using the full default library.
The plugin can preconnect to google-analytics.com to reduce latency and speed up requests. It also lets you set the cookie expiry period, force-disable display features functionality, and track logged-in administrators. Downloaded files can be renamed to random strings to help avoid ad blockers.
Compatibility with other tools
Compatibility Mode allows the locally hosted file to be used with other Google Analytics plugins. The listed examples include MonsterInsights Pro, ExactMetrics, Site Kit by Google, WooCommerce Google Analytics Integration, WooCommerce Google Analytics Pro, and Analytify.
CAOS also supports compatibility with cookie notice plugins, including Complianz, CookieYes, WP Cookie Notice, Cookie Notice & Compliance, and Cookie Notice & Consent Banner. Cloudflare Compatibility Mode is included for setups that use Cloudflare.
Privacy-oriented Pro features
CAOS Pro includes tools described for using Google Analytics with GDPR considerations. Randomize Client ID provides a fresh, untraceable UUID or ClientID for each visitor. Stealth Mode uses a customized API for WordPress that anonymizes visitor data before sending it to Google’s servers.
These controls are configuration features rather than a complete privacy policy or compliance service. Site owners should configure their analytics and cookie settings according to their own requirements.
Affiliate tracking
Pro also includes cloaked affiliate link tracking. This gives sites using affiliate links an additional tracking capability within the same analytics optimization workflow.
Installation and setup
- Install and activate CAOS Pro in WordPress.
- Enter your Google Analytics 4 Measurement ID.
- Choose whether tracking code should be added to the header, footer, or manually.
- Let CAOS download and save the local gtag.js file.
- Choose options such as Minimal Analytics 4, Compatibility Mode, CDN delivery, cookie expiry, or administrator tracking as needed.
- Review the privacy-oriented settings, including Randomize Client ID and Stealth Mode, when applicable.
WordPress’ scheduled Cron process keeps the locally hosted analytics file updated automatically.