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.
Activate Google Consent Mode UniConsent to enhance the accuracy of your Google Analytics and Google Ads conversion data.
Set up Google Consent Mode →Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign upLeading CMP UniConsent Partners with Google to Activate Consent Mode
RTL Belgium Ordered to Add "Reject All" Button and Stop Using Deceptive Colors on Cookie Banners
CCPA: What is Opt-Out Preference Signal (OOPS)
Google Consent Mode V2 Explained
New York Attorney General Releases Guidelines for Website Privacy Controls
Google's Recent Decision to Retain Third-party Cookies
Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign up