Files
att-consent/readme.txt
Steve Hanlon 6bf9f553de Initial commit: ATT Consent plugin v1.0.0
Google Consent Mode v2 cookie consent plugin with session attribution
preservation, custom script management, and gtag.js/GTM support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 05:45:42 +00:00

81 lines
4.4 KiB
Plaintext

=== ATT Consent ===
Contributors: attconsent
Tags: cookie consent, gdpr, consent mode, google analytics, gtm
Requires at least: 6.0
Tested up to: 6.8
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Google Consent Mode v2 cookie consent with session attribution preservation, custom script management, and full gtag.js/GTM support.
== Description ==
ATT Consent is a lightweight, self-contained cookie consent plugin that fully implements Google Consent Mode v2. It manages your cookie banner, sends the correct consent signals to Google, and preserves session attribution data even when users delay their consent decision.
**Key Features:**
* **Google Consent Mode v2** - Full implementation of all consent signals (ad_storage, analytics_storage, ad_user_data, ad_personalization, functionality_storage, personalization_storage)
* **Session Attribution Preservation** - Captures UTM parameters, GCLID, and referrer data on first page load. When consent is granted (even pages later), replays this data so GA4 session source/medium is correct
* **Basic & Advanced Consent Mode** - Choose between Advanced (tags load before consent, cookieless pings) or Basic (no tags until consent)
* **gtag.js & GTM Support** - Works with direct Google Analytics integration or Google Tag Manager
* **Custom Script Management** - Add JavaScript snippets via the admin that only execute after consent for their assigned category
* **4 Consent Categories** - Necessary (always on), Functional, Analytics, Marketing
* **Customisable Banner** - Colours, text, position (top bar, bottom bar, centre modal)
* **Accessible** - Keyboard navigation, focus trapping, ARIA attributes, screen reader friendly
* **WP Consent API Compatible** - Integrates with the WordPress Consent API for plugin interoperability
* **No External Dependencies** - Vanilla JavaScript frontend, no jQuery requirement
* **Caching Compatible** - Works correctly with page caching plugins
* **Translation Ready** - All strings are translatable
**How Attribution Preservation Works:**
1. On the first page of a session, UTM parameters, GCLID/DCLID, and the referrer are captured into sessionStorage (before any consent)
2. When the user grants consent (even on a subsequent page), this stored attribution data is replayed via `gtag('set')` before the consent update fires
3. This ensures GA4's `session_start` event records the correct traffic source, not "(direct) / (none)"
== Installation ==
1. Upload the `att-consent` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Cookie Consent > General and enter your GA4 Measurement ID or GTM Container ID
4. Customise the banner text and appearance under the Appearance tab
5. Optionally add custom scripts under the Custom Scripts tab
== Frequently Asked Questions ==
= What is the difference between Basic and Advanced consent mode? =
**Advanced mode** (recommended): Google tags load immediately and send cookieless pings even before consent. This gives Google data for behavioural modelling while still respecting consent. Most sites should use this.
**Basic mode**: No Google tags load until consent is granted. Maximum privacy but you lose behavioural modelling data.
= Does this work with page caching? =
Yes. The banner HTML is always rendered on the page. JavaScript checks for the consent cookie and hides the banner if consent has already been given. This means cached pages display correctly.
= Can I use this with Google Tag Manager? =
Yes. Set the tracking mode to GTM in the General settings and enter your container ID. The plugin will inject the GTM container and manage consent signals via the dataLayer.
= How do custom scripts work? =
You can add JavaScript snippets in the Custom Scripts tab. Each snippet is assigned to a consent category (Functional, Analytics, or Marketing) and a placement (Head or Footer). The script only executes after the visitor consents to that category.
= Does this replace my existing consent plugin? =
Yes. Deactivate and remove your existing consent plugin (e.g., CookieYes, Complianz) before activating ATT Consent to avoid conflicts.
== Changelog ==
= 1.0.0 =
* Initial release
* Google Consent Mode v2 with all signals
* Session attribution preservation
* Basic and Advanced consent modes
* gtag.js and GTM support
* Custom script management
* Customisable banner and preferences modal
* WP Consent API integration