soderlind/kjeks-google

Google Consent Mode v2 for Kjeks: wires GA4 and Google Tag Manager to the visitor's Kjeks consent choices.

Maintainers

Package info

github.com/soderlind/kjeks-google

Type:wordpress-plugin

pkg:composer/soderlind/kjeks-google

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.3.1 2026-08-20 00:02 UTC

This package is auto-updated.

Last update: 2026-08-20 14:12:02 UTC


README

Google Tag Manager and Google Analytics 4 for Kjeks, wired through Consent Mode v2. Requires the Kjeks plugin.

Part of the kjeks family — an adapter over the Kjeks public API. See the kjeks ecosystem overview.

Installation

  1. Install and activate Kjeks first — this add-on requires it.
  2. Download the latest kjeks-google.zip.
  3. In WordPress, go to Plugins → Add New → Upload Plugin and upload the zip.
  4. Activate the plugin (on multisite, Network Activate it).

The plugin updates itself automatically via GitHub releases using plugin-update-checker.

How it works

Two layers keep Google inside the Kjeks consent layer (see Kjeks grilling Q7):

  1. Consent Mode v2 defaults are denied — before any Google code runs, the add-on sets ad_storage, ad_user_data, ad_personalization, and analytics_storage to denied.
  2. The container is gated — the GTM/gtag container is registered with Kjeks as an inert script and only activates when the configured category is granted, so Google can never load before consent.

When the visitor changes their choice, the add-on pushes a Consent Mode update, mapping:

Kjeks category Consent Mode signals
analytics granted analytics_storage: granted
marketing granted ad_storage, ad_user_data, ad_personalization: granted

Configuration

  • Network Admin → Settings → Kjeks Google — network defaults (multisite).
  • Settings → Kjeks Google — per-site overrides; blank inherits the default. On a single site this is where you configure everything.

Fields: GTM container ID (GTM-XXXXXX), GA4 measurement ID (G-XXXXXXX), and the category that must be granted before the container loads (default analytics).

Filters

  • kjeks_google_config — filter the resolved { gtm_id, ga4_id, gating_category }.

Notes and limitations

  • The GTM <noscript> iframe fallback is intentionally omitted; it would bypass the JavaScript consent gate.
  • Gating uses a single category. If a container mixes analytics and advertising tags, choose the stricter category or split containers.
  • This add-on assists with consent wiring; it does not guarantee legal compliance.

License

GPL-2.0-or-later