WS GA

v2.2.0WordPressWP 7.1PHP 7.4+GPL-2.0-or-later

Adds the Google Analytics 4 tag (gtag.js) to a WordPress site. One settings screen holds the Measurement ID and the config switches. With "Respect cookie consent" on, a small loader waits for the visitor's consent before it loads Google's script, so Google receives nothing before consent. One file, no tables, no cron.

Download v2.2.0

What it does

Settings

Content-Security-Policy

The tag needs script-src https://www.googletagmanager.com and connect-src for https://www.google-analytics.com and https://analytics.google.com (plus the regional *.google-analytics.com hosts). WS Security's services list has a Google Analytics entry that adds them. With the consent loader on, the inline loader itself needs its hash in script-src; WS Security's hash collector picks it up.

Requirements

Install

  1. Download the zip above.
  2. In WordPress go to Plugins, Add New, Upload Plugin, and upload it.
  3. Activate WS GA from the Plugins screen, then enter the Measurement ID under Settings, Google Analytics.

Updates are self-hosted: the plugin reads its Update URI header and checks https://websqu.ad/updates/ws-ga.json. New versions show up in the standard WordPress updates screen. Deleting the plugin removes its five options.

Not included

Google Consent Mode v2 is not implemented: the plugin either loads gtag or does not. Logged-in administrators are tracked like everyone else.

Changelog

websquad — brandsquad OÜ, Estonia. Support: [email protected]

WP Plugins · Homepage