Documentation

How to collect consent for Google Ad personalization

In order to comply with Google’s updated EU Consent policy, publishers wishing to run personalized ads via Google services like Adsense are required to ensure that explicit consent to ad personalization is collected before displaying personalized ads for end-users based in the EAA (European Union member states and Iceland, Liechtenstein, and Norway).

Please note that where this requirement is not met (where consent is not collected for the personalization of ads), Google will serve your EEA end-users with non-personalized ads by default, potentially impacting your ad revenue.

What you need to do

To meet this requirement, you must give users the opportunity to consent to or reject processing for Google’s ad personalization. The Cookie Solution’s IAB Advertising Preferences Management setting makes this process fairly easy.

Attend our “Consent management for publishers” webinar

View a live demo and have your questions answered in real time by attending our free english “Consent management for publishers” webinar. Discover in practice how you can meet both compliance and advertising industry requirements while ensuring that your ad-reach is maximized.

Sign up now

Setup

First, ensure that you’ve enabled the Cookie Solution’s IAB Advertising Preferences Management option (as explained here).

Next, click on the channel dropdown field at the top right of the Cookie Solution embed section and select “beta” (currently this feature is only available on the beta channel).

Cookie Solution Beta Channel

Please note that the “Request new consent” option must be enabled. You can do this by going to Cookie Solution > Edit > Advanced View and selecting the relevant setting under IAB Transparency and Consent Framework section.

Lastly, be sure to add the googleAdsPreferenceManagement option to your code snippet and set to true as can be seen in the example below.

<script type="text/javascript">
    var _iub = _iub || [];
    _iub.csConfiguration = {
        "lang": "en",
        "siteId": XXXXXXX, //use your siteId
        "cookiePolicyId": XXXXXXX, //use your cookiePolicyId
        "enableCMP": true,
        "googleAdsPreferenceManagement": true
    };
</script>
Caution

In order to complete the installation of these settings, please ensure that you have the latest version Cookie Solution beta channel code snippet embedded on your site header.

When this setting is enabled, end-users will see an additional “Google toggle” that allows them to choose between personalized or non-personalized Google ads as required.

Implementation

Now, to ensure that non-personalized ads are sent when indicated by the user, you’ll need to modify your Google scripts using the following:

_iub.cs.api.isGoogleNonPersonalizedAds()

The value is set to true where consent has not been given and false where it has been given.

The function is valorized after the consent has been given.

Please note that these instructions assume that you’ve previously set up prior-blocking for these Google services and have therefore modified the scripts as referenced below.

If you’ve instead set-up prior blocking of these scripts using Google features, jump to this section.

For Google Publisher Tag

In your Publisher Tag embed code, insert the following code snippet

<script type="text/plain" class="_iub_cs_activate">
    googletag.cmd.push(function () {
        googletag.pubads().setRequestNonPersonalizedAds(_iub.cs.api.isGoogleNonPersonalizedAds() ? 1 : 0); 
    });
</script>

between lines 16 and 17 of the After section specified here in this post.

Google Adsense

In your Adsense Async code, insert the following code snippet

(adsbygoogle=window.adsbygoogle||[]).requestNonPersonalizedAds=_iub.cs.api.isGoogleNonPersonalizedAds() ? 1 : 0;

between lines 8 and 9 of the Asynch > After section specified here in this post.

*The example above uses only the Asynchronous tag as the Synchronous tag does not support non-personalized ads. Read more about that here.

Other Implementation Methods

If you’ve instead set-up prior blocking of these scripts using Google features, you can follow Google’s instructions here (under Pausing ad requests).

You’ll need to make adjustments as follows:

  1. When using Google Publisher Tag setRequestNonPersonalizedAds(1) should be replaced with setRequestNonPersonalizedAds(_iub.cs.api.isGoogleNonPersonalizedAds() ? 1 : 0)
  2. When using AdSense or Ad Exchange asynchronous ad code requestNonPersonalizedAds=1 should be replaced with requestNonPersonalizedAds=_iub.cs.api.isGoogleNonPersonalizedAds() ? 1 : 0

See also

Still have questions?

Visit our support forum Email us