Quantcast Choice is a popular Consent Management Platform (CMP) for publishers for good reasons. It’s well proven, easy to set-up, free to use and utilises the IAB Consent Management Framework.
That framework ensures that the consent users give is passed to every demand partner who has also adopted the standard framework. The problem that publishers face is that Google aren’t signed up to that framework, so additional steps are needed to ensure that any Google ads served to a user honour that user’s consent preference.
Tying ads behind a yes/no to consent
The simplest solution is to delay showing ads to the user until after consent has been gained. Great! But how do you actually do that?
Firstly, you’ll want to make sure you are not going to serve ads until the user has agreed to your consent popup. To do this we need to use the disableInitialLoad() function within Google’s API.
You’ll need to make sure that the disableInitialLoad() function is before enableServices().
To get the ads to fire after consent is recorded we will use the refresh() function, but more on that later.
Implementation within Quantcast choice CMP
In order for the CMP to perform its duties, we need to link our decision to serve personalized ads with what consent is recorded by the CMP.
To do that we will use the following code, appended to the bottom of the ‘out of the box’ Quantcast choice code:
How does this work?
Once the CMP has loaded, this extra snippet will make the decision on whether or not personalized ads are shown.
If the CMP records a positive result and the user has given their consent for personalized ads, the refresh() function is called, overriding the previous disableInitialLoad() function and your Ad Manager ad units will fire as normal.
If no consent is given by the user, the CMP will change the request to Ad Manager to only retrieve non-personalized ads using the function: setRequestNonPersonalizedAds(1).
For more information on the EU User Consent Policy, download our free guide.
After studying Computing at the University of Portsmouth, Zack joined the OKO team in 2018 as a Publisher Development Manager and achieved his GCPP certification shortly after. As a Platform Specialist, Zack’s role is to manage new publisher integrations, carry out data analysis and provide technical problem solving and support.