Iubenda logo

Documentation

Table of Contents

How to Collect Consent for Google Ad Personalization

Using Google Ads and got an alert from Google? Here’s how to troubleshoot

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.

🎙️
Ask our experts live

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.

Attend our free webinar

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. Thanks to our support for the Transparency and Consent Framework v2.0, our Cookie Solution makes this process fairly easy.

Transparency and Consent Framework v2.0

Google has officially integrated IAB’s Transparency and Consent Framework v2.0 and is now included on the TCF global vendor lists.

Important

With the TCF v2.0, separate Google ad personalization settings are no longer be needed (or supported). Any related integration (i.e. googleAdsPreferenceManagement and isGoogleNonPersonalizedAds) should be removed.

Furthermore, please note that if you’re a publisher serving ads via Google and use the TCF, you must use the first blocking method detailed here (under “Directly blocking the vendor scripts”) in order to avoid error 2.1a (explained in detail here).

If you’d like to manually block Google’s scripts, you can also directly reference the examples here for Google AdSense and Google Publisher Tag.

You can read Google’s release on publisher integration with the IAB TCF v2.0 here.

Read our transition guide to understand all the new features and benefits that come with the new version, and what action you need to take in order to make the switch.

Using Google Ads and got an alert from Google? Here’s how to troubleshoot

First of all, make sure that you have the Transparency and Consent Framework active. If the TCF is active and you’re getting a specific error, here’s how to solve some of the common error codes:

  • Error 1.1: This occurs if the user doesn’t give consent to Google’s ads. This means that almost any website will get it at least some 1.1 errors. This error is perfectly normal as long as the number of occurrences is in line with the number of users choosing “Reject” on the cookie notice (if implemented), or disabling ad tracking manually through the TCF preferences. This error, therefore, should only cause concern if it’s abnormally high;
  • Error 2.1a: Upon investigating directly with Google, it has emerged that Google will not serve ads, not even non-personalized ads, if the user has not expressed a preference in regards to cookies. We support two main implementation methods for our Cookie Solution, illustrated here. If you work with Google ads, and you’re getting this error you must mandatorily use the first method.
  • Error 4.1: This error occurs when the TC string being generated is using a version of the Global Vendor List (GVL) that doesn’t include Google, because it was collected pre-August 1st (i.e before Google joined the GVL). You can fix this error by setting "invalidateConsentBefore": "2020-08-01" (available in beta and current, not yet in stable), as per example here.

If after applying these fixes the alert does not disappear, don’t hesitate to contact us via our live chat or email if you need any further assistance or clarification. We’re happy to help.

Our Cookie Solution also supports Google’s Additional Consent Mode, which allows you to gather consent for Google ad partners that are not yet part of the Transparency and Consent Framework but are on Google’s Ad Tech Providers (ATP) list. This feature is available via the Current channel.

Important

Similarly to the above, you’ll have to remove any NPA (non-personalized ads, i.e. googleAdsPreferenceManagement and isGoogleNonPersonalizedAds) integration if you still have it in place.

To enable this feature, be sure to select the Current channel, then select the following checkbox within the Cookie Solution configurator (in some cases the checkbox will be automatically selected when you enable the TCF for the first time).

This will add "googleAdditionalConsentMode": true to your code snippet as can be seen in the example snipped below.

<script type="text/javascript">
    var _iub = _iub || [];
    _iub.csConfiguration = {
        "lang": "en",
        "siteId": XXXXXX, //use your siteId
        "cookiePolicyId": YYYYYY, //use your cookiePolicyId
        "enableTcf": true, //enable IAB TCF 
        "tcfVersion": 2, //TCF v2.0
        "googleAdditionalConsentMode": true, //enables Google's Additional Consent Mode
        "banner": {
            "position": "float-top-center",
            "acceptButtonDisplay": true, //explicit accept button, as requested by IAB
            "customizeButtonDisplay": true //explicit customize button, as requested by IAB
        }
    };
</script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/beta/stub-v2.js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/beta/safe-tcf-v2.js"></script> <!-- add this line if you don't use prior blocking for vendor scripts -->
<script type="text/javascript" src="//cdn.iubenda.com/cs/beta/iubenda_cs.js" charset="UTF-8" async></script>

Below you’ll find the procedure valid before Google integrated the TCF v2. Keep in mind that on since 15 August 2020 TCF v1.1 is no longer supported by IAB.

Setup

First, ensure that you’ve enabled the Cookie Solution’s IAB Advertising Preferences Management option as explained here (you can enable this feature also on Cookie Solution > Edit).

Cookie Solution's IAB Advertising Preferences Management option

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.

IAB Transparency and Consent Framework - Request new consent

Finally, make sure to enable the “Google’s ad preference management” option, adding "googleAdsPreferenceManagement": true to your code snippet:

<script type="text/javascript">
    var _iub = _iub || [];
    _iub.csConfiguration = {
        "lang": "en",
        "siteId": XXXXXX, //use your siteId
        "cookiePolicyId": YYYYYY, //use your cookiePolicyId
        "enableCMP": true,
        "googleAdsPreferenceManagement": true,
        "banner": {
            "position": "float-top-center",
            "acceptButtonDisplay": true,
            "customizeButtonDisplay": true
        }
    };
</script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/stub.js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>

In order to complete the installation of these settings, please ensure that you have the latest version of the 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.

Google toggle that allows users to choose between personalized or non-personalized Google ads
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

Consent to Google and its partners is collected via a single boolean toggle which works in parallel with the consent collected via the TCF as Google does not currently read TCF consents. For this reason, Google has advised the following in regards to the ATP list.

Do:

  • simply upload a static list.

Do not:

  • try to automate the process of outputting the IDs from the TCF data; or
  • try matching the TCF list with the ATP list.

The list can be download from Google Display Planner and then shared with SSPs – Sell Side Platform – (like FreeWheel) and alike.

If you use a static list with FreeWheel, when the Google toggle is off – meaning that consent has not been given and _iub.cs.api.isGoogleNonPersonalizedAds() is set to true – you’ll need to pass _fw_gdpr_consented_providers=216 in the ad request (216 is the Google id for FreeWheel).

This way you can override the hardcoded list in FreeWheel, and more assuredly indicate that consent was not collected. For implementation assistance, reach out to your FreeWheel account team.

If you prefer avoid using the TCF but still need to handle personalised/non-personalised ad requests, please contact us.

See also