Revoking cookie consent in Magento 2. What changes before the next event?

2 min read

A phone with a preferences panel and a hand beside a switch

In a test shop session on one domain, accept the optional categories. Reopen cookie preferences, turn off the optional categories and save. Check the consent signal before the next event on the same page, then move to another page. Record when you saved and the event order.

Compare the saved preference with the consent commands

In Kowal Cookie Consent 1.1.5, changing preferences stores the categories in cookie_consent_level. With the module enabled, its template emits a default of denied for analytics and ads. Its initialisation script issues a granted update when the library reports that scripts in the targeting category loaded. Kowal Cookie Consent · Module documentation

Check the current page and the next page

In the local test with the original module code, saving set targeting to false. Before the next event on the same page, the latest command in the queue was still the earlier granted. The next page showed the default denied. The test recorded browser commands without connecting to Google.

Sequence observed in the local test
StepSaved targeting valueLast command for analytics_storage
First visitfalsedefault · denied
After acceptancetrueupdate · granted
After revocation on the same pagefalseupdate · granted
On the next pagefalsedefault · denied

Confirm the state at the next event

In Tag Assistant, check analytics_storage, ad_storage, ad_user_data and ad_personalization. Compare the state at save time and just before the next event. If the update to denied is missing, check the integration that passes the new choice to tags and repeat the test after adjusting it. For advanced mode, also check the cookieless measurements expected for denied. Consent debugging in Tag Assistant · Google consent modes

For navigation between hosts, see the earlier guide to consent across domains.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)