Repository navigation
Conversation
…ault Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Send the Google Consent Mode settings recommended by Google with the default consent state:
wait_for_updateandads_data_redactionon by default, andurl_passthroughavailable but off. First PR of block 2 (Consent Mode v2).Findings
wait_for_update, 500 ms)gclid) reach Google Ads while ads storage is deniedads_data_redaction)url_passthrough)url_passthroughback to false)functionality_storage,personalization_storageandsecurity_storagesignalsChanges
Consent Mode default
CookieNotice::get_consent_mode_settings()returns the three settings, each with a filter:frcn_cookie_notice_consent_mode_wait_for_update(default 500, 0 disables it),frcn_cookie_notice_consent_mode_ads_data_redaction(default true) andfrcn_cookie_notice_consent_mode_url_passthrough(default false). No admin settings.wp_headdefault script addswait_for_updateto the state and callsgtag('set', 'ads_data_redaction', true)/gtag('set', 'url_passthrough', true)when enabled.wait_for_updateis added last, after an add-on's state (frcnCookieNoticeConsentModeState, e.g. FrontConsent PRO's per-category state) and the stale-consent check, so it is kept in every case.CSP fallback
The same settings are localized as
frcnCookieNotice.consentModeand applied bysetConsentModeDefault(), used when a Content Security Policy blocks the inline script. A page cached before this change (withoutconsentMode) sends the default exactly as before.Assets and documentation
npm run build.readme.md.Tests
CookieNoticeConsentModeSettingsTest(4 PHP tests) andtests/js/consent-mode-defaults.test.js(5 JS tests): defaults, filters, negative wait ignored, localized settings, add-on state keepingwait_for_update, and the old behavior without the localized settings. The 4 PHP tests and 3 of the JS tests fail without the change.composer validate,composer lint,composer phpstan, PHPUnit (145/145) andnpm run test:js(54/54). FrontConsent PRO's tests also pass against this branch (116/116, JS 7/7).wait_for_update: 500andads_data_redactionand reaches the dataLayer beforegtm.js; Google reports the default as set in time (wasSetLate: false) and GA4 hits carrygcs=G100while denied.url_passthroughon: clicking an internal link addsgclidto it; off: the link is unchanged.ads_data_redactionon: the Google Ads request carriesgclid=0; off: the realgclidis sent.wait_for_updatewith the visitor accepting after 300 ms: the page view waits and is sent as granted (gcs=G111); without it, it is sent before the decision as denied (gcs=G100).Scope
No version bump or changelog changes.
🤖 Generated with Claude Code