UniConsent
GDPR flag
It is important to understand the consent given rate on a website for most publishers installed a paid or free IAB CMP (Consent management platform/manager).
Consent given rate is important for publishers regarding the revenue of display ads after GDPR. Most demand partners bid the inventory based on consent signals.
Google analytics provides the Javascript API for custom event measurement. Publishers can measure the GDPR consent given rate by users with Google analytics. This article shows how to measure and gain insight into the consent given at IAB CMP.
Before getting started, it is worth mentioning there is a tool for debugging: Google Analytics Debugger. It is a Chrome plugin, once installed, you are able to see the detail logs at Chrome console how the webpage communicates with Google Analytics:
Google analytics custom event measurement API:
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
When the Google analytics is installed with Google tag manager, you might see the error:
Command ignored. Unknown target: undefined
This is because the tracker
is unknown in your context scope, tracker can be get in this way:
var trackers = window.ga.getAll()
var tracker = trackers[0].a.data.values[':name']
Then send custom events with the tracker:
ga(
tracker + '.send',
'event',
[eventCategory],
[eventAction],
[eventLabel],
[eventValue],
[fieldsObject]
)
All the IAB certified CMP like UniConsent provide the following API to access to the choices given by a user:
window.__cmp('getPublisherConsents', null, function (result) {
console.log(result)
})
The result looks like this:
If you like to measure how many people selected yes on 'Information storage and access', you can do like this:
var trackers = window.ga.getAll()
var tracker = trackers[0].a.data.values[':name']
window.__cmp('getPublisherConsents', null, function (result) {
var choice1 = result.standardPurposeConsents[1] ? 'Yes' : 'No'
ga(
tracker + '.send',
'event',
'IAB CMP',
'Consent',
'Information storage and access',
choice1
)
})
The API of IAB Europe's TCF v2.0 is slightly different from v1.0. But the concept is the same.
UniConsent has built-in consent Analytics and Insight feature. You are able to see how many people give positive consent and details.
Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign upEuropean Digital Markets Act (DMA) enforcement, Consent Mode and Consent Management
IAB GPP: Prepare and Enable Global Privacy Platform in 2024
Google Consent Mode V2 Deadline is Approaching
Google Certified CMP: Google Certified CMP Enforcement for AdSense, Ad Manager, and AdMob
Meta's 'Pay or Okay' Model: Legal and Ethical Implications for Publishers
UK ICO Call for Reject All Button on Cookie Banners: Navigating Compliance and Privacy
Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign up