Google Consent Mode v2 setup example (Beautiful Cookie Banner)

This page shows step by step how to set up Google Consent Mode v2 with Beautiful Cookie Banner, with three example configurations and the result in Google’s Tag Assistant. For the background (what Consent Mode v2 is, basic and advanced mode, what the plugin sends), read Google Consent Mode v2 for WordPress first.

Disclaimer: this page describes the technical setup only. It is not legal advice.

Before you start

Go to Settings > Cookie Consent Banner > Consent APIs > Google Consent Mode and check Enable Google Consent mode. From then on, every consent type is sent as denied unless you map it to a category.

For each consent type, switch on the banner categories that grant it. The required types for Google Ads and Analytics are:

  • analytics_storage
  • ad_storage
  • ad_user_data (new in v2)
  • ad_personalization (new in v2)

A consent type is granted as soon as one of its categories is allowed. It is granted by default (before the visitor chooses) if one of its categories is “default checked” in Compliance & Behaviour.

Step 3: Example configurations

The screenshots of the results were taken with Tag Assistant.

Compliance settings

Compliance settings of Banner 1 with the categories 'tech' (default checked) and 'marketing'.
Consent Mode mapping: analytics_storage, ad_storage and personalization_storage granted for 'marketing'; ad_personalization, ad_user_data and functionality_storage granted for 'tech'.

Result

On the first page load:

  • analytics_storage: denied
  • ad_storage: denied
  • ad_personalization: granted
  • ad_user_data: granted
  • functionality_storage: granted
  • personalization_storage: denied
  • security_storage: denied

ad_personalization, ad_user_data and functionality_storage are granted because tech is “default checked”. If the visitor now allows marketing, everything except security_storage is granted.

Example 2: Banner 2

Compliance settings

Categories of Banner 2: Technical (default checked) and Marketing.
Consent Mode mapping for Banner 2: analytics_storage, ad_storage and personalization_storage granted for 'Marketing'; ad_personalization, ad_user_data and functionality_storage granted for 'Technical'.

Result

On the first page load:

Tag Assistant, Consent Default event: ad_storage, analytics_storage, personalization_storage and security_storage denied; ad_user_data, ad_personalization and functionality_storage granted.

ad_personalization, ad_user_data and functionality_storage are granted because Technical is “default checked” in the categories settings. If the visitor now allows Marketing, everything except security_storage is granted.

On the visitor’s next page view, the default is still “denied”, but the update with “granted” comes immediately after the default:

Tag Assistant, Event Consent State on the next page view: on-page default denied, on-page update granted for all types except security_storage.

Example 3: Banner 1, compliance type “Opt-in”

Compliance settings

Compliance & Behaviour tab of Banner 1 with the compliance type 'Ask user to Opt-in'.
Consent Mode mapping for opt-in: analytics_storage granted for 'opt-out/default' only; ad_storage granted for 'opt-in' or 'opt-out/default'; all other types granted for 'opt-in'.

Result

On the first page load:

Tag Assistant, Event Consent State on the first page load: ad_storage and analytics_storage granted, all other types denied.

analytics_storage and ad_storage are granted because their toggles are on for “opt-out/default”.

If the visitor now opts in, everything except analytics_storage is granted. analytics_storage changes to “denied” because only its “opt-out/default” toggle is on, not the “opt-in” one. In practice you usually switch on both toggles.

Tag Assistant after opt-in: on-page update granted for all types except analytics_storage, which changes to denied.

On the visitor’s next page view, the default is still “denied”, but the update with “granted” comes immediately after the default:

Tag Assistant on the next page view after opt-in: on-page update granted for all types except analytics_storage.

Step 4: Check the result

Your tags still fire the way you configured them; their requests now carry the consent state. Check it with the guide How to test and check Google Consent Mode v2.

Further reading