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

2 min read

A phone showing preferences and a hand beside a switch

In a test shop session on one domain, accept the optional categories. Reopen the 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. Note the save time and event order.

Compare the stored choice with the consent commands

Kowal Cookie Consent 1.1.5 stores the categories in cookie_consent_level. When the module is enabled, its template emits denied by default for analytics and advertising. 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 code, saving set targeting to false. Before the next event on the same page, the latest queued command was still the earlier granted. On the next page, the default was denied. We recorded browser commands without connecting to Google.

Order observed in the local test
StepSaved targeting valueLast command for analytics_storage
First visitfalsedefault · denied
After acceptancetrueupdate · granted
After withdrawal 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 how the choice gets passed to tags and repeat the test after an adjustment. In advanced mode, check the cookieless measurements that are expected for denied. Consent debugging in Tag Assistant · Google consent modes

For navigation between hosts, see the 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)