Consent data can be extracted using the Cookiebot data API by calling this URL:
https://consent.cookiebot.com/api/v1/{apikey}/json/domaingroup/{serial}/domain/{domain}/({domainpath}/)consent/stats?startdate={startdate}&enddate={enddate}
Here is an overview of the placeholders:
{apikey}
The secret API key for your Cookiebot account is available in the Cookiebot Manager, under Settings on the Your scripts tab
{serial}
Domain group ID is available in the Cookiebot Manager, under Settings on the Your scripts tab
{domain}
Domain name as registered in the Cookiebot Manager
{domainpath}
Optional (Only used if a domain path is configured)
{startdate}
The start date in YYYYMMDD format
{enddate}
The end date in YYYYMMDD format
Please note:
Data cannot retrieved beyond 12 months previous to the current date.
A successful request will return a response with the following data:
{
"domain": "www.domain.com",
"urlpath": "/",
"utcstartdate": "YYYY-MM-DDT00:00:00.0000000Z",
"utcenddate": "YYYY-MM-DDT23:59:59.9990000Z",
"consentstat": {
"consentday": {
"Date": "YYYY-MM-DDT00:00:00",
"OptIn": "0",
"OptOut": "0",
"OptInImplied": "0",
"OptInStrict": "0",
"TypeOptInPref": "0",
"TypeOptInStat": "0",
"TypeOptInMark": "0",
"BulkOptInImplied": "0",
"BulkOptInStrict": "0",
"Countries": {
"Country": [
{
"Code": "aa",
"Count": "0"
}
]
}
}
}
}
- Domain
- URL path (if applied)
- Start date (UTC)
- End date (UTC)
- Consent stats
For each day:
- Date
- Number of opt-ins
- Number of opt-outs
- Number of implied opt-ins 1
- Number of strict opt-ins 2
- Number of opt-ins in the preferences category
- Number of opt-ins in the statistics category
- Number of opt-ins in the marketing category
- Number of implied bulk consent opt-ins 3
- Number of strict bulk consent opt-ins 4
- Countries
For each country:
- Country code (ISO 3166-1 alpha-2)
- Number of consents
The data extracted by making this call is the same data that can be found under the Consents section in the Cookiebot Manager and is also available for download from your account: Where can I access the consent log for documentation of user consents?
Please see more info on the consent log: Introduction-Logging-and-demonstration-of-user-consents
1
Consent submitted by ignoring the banner and interacting with the page when having the "Implied consent" method enabled in the Manager. This behavior is not active by default.
Implied consent can also be triggered if the banner is configured to only ask for consent in specific regions. Visitors outside of these regions will automatically be opted-in.
2
Consent submitted by clicking on one of the buttons on the banner.
This is often referred to as Active or Explicit consent and is the default consent method.
3
Consent submitted by previously actively submitting consent, by clicking on one of the buttons on the banner on another domain within the same domain group where Bulk Consent is enabled.
For more information about Bulk Consent please review this article
4
Consent submitted by ignoring the banner and interacting with the page when having the "Implied consent" method enabled in the Manager on another domain within the same domain group where Bulk Consent is enabled.
For more information about Bulk Consent please review this article
Comments
0 comments
Please sign in to leave a comment.