Skip to main content

Integration with Google Consent Mode

Consent Mode V2 is an integration that maximizes control and transparency in managing user consent on your website: until the user has given consent, their data will not be saved.

WARNING: For any issues encountered during the integration of Google Consent Mode with the CMP, please reach out to our technical support team first at support@avacysolution.com. Google support will be involved only if necessary.

For more informations check the official Google documentation guide.

The difference between these two modes of Google Consent Mode lies in how tags are blocked: the Basic mode simply blocks tags when consent is denied. In Advanced mode, when consent is denied, Google tags are still activated, but the data is sent anonymously (unless ads_data_redaction is set to TRUE).

NOTE: It is recommended to consult a legal expert before proceeding with this latter mode.

The advanced mode can be enabled when creating a tag by selecting the "Not Set" option in the consent settings. In this guide, we will proceed with the basic mode.

From the Google Tag Manager dashboard, click on Administration and then Container Settings

Alt text

From here, check the box for Enable Consent Overview.

Alt text

On the Avacy platform, go to the dashboard of the relevant website where you want to enable Google Consent Mode support. Go to the Cookie Banner section and, in the Advanced Settings, under Google Consent Mode Support, select Enable. This will allow a new section to appear in the cookie banner preferences panel, containing purposes for managing Google consent indicators.

Alt text

The purposes in the Avacy cookie banner are associated with the consent indicators as follows:

GTM Consent IndicatorPurpose on Cookie Banner
ad_storageManaging cookies or device advertising identifiers
ad_personalizationData sharing with Google for its advertising purposes
ad_user_dataReceiving personalized ads
analytics_storageEnabling Google Analytics features
functionality_storageStoring technical settings
personalization_storagePersonalizing content
security_storageTracking for security purposes

Configuration

Once this is done, return to the container and, in the tag list, click on the shield icon at the top right.

Alt text

A summary of the tags will be displayed, showing those that have not yet been configured with Google Consent Mode and those that have been correctly configured.

Some tags are configured with built-in consent indicators (usually Google tags, e.g., Google Analytics) and automatically adjust their tracking services based on these indicators. Other tags do not have built-in consent indicators, so to integrate Consent Mode, you need to set additional consent indicators.

Alt text

Let's take the integration of a Facebook Pixel as an example.

Once the tag has been added to the container, click on the pencil icon and scroll down to Advanced Settings. Then click on Consent Settings and select the option Additional consent required for tag activation.

Alt text

As shown in the picture, manually set one or more consent indicators supported by Google, described in the previous table.

In the Triggers section, create a new "Custom Event" trigger and set the event name to avacy_consent_update.

Alt text

Next, link this trigger to the Facebook Pixel in the "Triggering" section of the tag.

Testing

At this point, following the Facebook Pixel example, the tag should only activate if consent is given for the purpose related to the ad_storage indicator, in other words, if that particular feature is accepted from the platform's cookie banner.

Alt text

We can verify from the container preview that, by checking the Managing cookies or advertising device identifiers purpose in the cookie banner, the avacy_consent_mode event is indeed triggered through the dataLayer API. At this point, the tags triggered by this event will automatically determine whether they should be activated based on the consent indicators we specified for them.

In this case, since we set the ad_storage indicator for the Facebook Pixel, we can verify from the debugger that the tag is activated when the event is triggered.

Alt text

Similarly, in the Consent tab of the debugger, we can check how the consent indicators have changed based on the preferences expressed.

Alt text

As a cross-check, we can activate all purposes except those required to activate the Pixel, and verify that it remains effectively blocked.

Alt text

We then return to the debugger and verify that the consent indicators are set accordingly:

Alt text

Finally, we verify that the Facebook Pixel remains deactivated because the necessary consent indicator was not provided.

Alt text

If the result is as expected, the preventive block for the Pixel has been successfully configured.