Skip to main content

Consent events and GDPR

Snowplow provides out-of-the-box events and entities to track user consent preferences and GDPR compliance. Use these to capture consent decisions, track changes to user preferences, and monitor Consent Management Platform (CMP) performance.

You can also configure your tracker not to track certain identifiers, depending on user consent, using anonymous tracking.

Snowplow provides two versions of consent tracking APIs:

  • Enhanced consent APIs: available for web only using the Enhanced Consent plugin, these APIs track detailed consent preferences and CMP visibility events
  • Basic consent APIs: available for mobile, these APIs track basic consent activity

To process raw events created by the Snowplow Enhanced Consent plugin, use the consent module in the Snowplow Unified Digital dbt package.

Models support enhanced consent only

The Snowplow dbt packages don't support the basic consent events and entities. You can however build your own models based on the raw events.

Tracker support

This table shows the support for consent tracking across the main client-side Snowplow tracker SDKs. The server-side trackers don't include consent tracking APIs.

Older versions of the web trackers provided the browser-plugin-consent plugin for basic consent tracking. It was deprecated in version 4 in favor of browser-plugin-enhanced-consent.

TrackerSupportedSince versionAuto-trackingNotes
Web3.0.0 - 4.0.0 (basic), 3.8.0 (enhanced)✅/❌Track enhanced consent events manually; configure automatic addition of GDPR entity
iOS1.0.0✅/❌Track basic consent events manually; configure automatic addition of GDPR entity
Android1.0.0✅/❌Track basic consent events manually; configure automatic addition of GDPR entity
React Native1.0.0Basic API*; no GDPR entity
Flutter0.1.0Basic API
RokuTrack custom events using the enhanced schemas
Google Tag Managerv3Enhanced consent events

*It's also possible to use the JavaScript Enhanced Consent plugin with the React Native tracker.

Events and entities

This section describes the events and entities used in Snowplow consent tracking.

Enhanced

The Enhanced Consent plugin includes a number of tracking calls for different user consent actions:

APITo track
trackConsentAllowAcceptance of user consent
trackConsentSelectedA specific selection of consented scopes
trackConsentPendingThe unconfirmed selection about user consent
trackConsentImplicitThe implicit consent on user consent preferences
trackConsentDenyA denial of user consent
trackConsentExpiredThe expiration of a consent selection
trackConsentWithdrawnThe withdrawal of user consent
trackCmpVisibleThe render time of a consent management platform banner

With the exception of the CMP visible event, these methods use the same consent_preferences event schema. The CMP visible event uses the cmp_visible schema.

consent_preferences

Event
Schema for consent preferences selection event
Schema URIiglu:com.snowplowanalytics.snowplow/consent_preferences/jsonschema/1-0-0
Example
json
{
"basisForProcessing": "consent",
"consentVersion": "1",
"consentScopes": [
"necessary",
"preferences",
"statistics"
],
"domainsApplied": [
"https://www.example.com/"
],
"consentUrl": "https://www.example.com/",
"eventType": "allow_selected",
"gdprApplies": false
}
Properties and schema
PropertyDescription
eventType
Required. The action for the consent preferences of a user.
Must be one of: deny_all, allow_all, allow_selected, pending, implicit_consent, withdrawn, expired
basisForProcessing
Required. GDPR lawful basis for data collection & processing.
Must be one of: consent, contract, legal_obligation, vital_interests, public_task, legitimate_interests
consentUrl
string
Required. URI of the privacy policy related document.
consentVersion
string
Required. Version of the privacy policy related document.
consentScopes
array
Required. The scopes allowed after the user finalized his selection of consent preferences. E.g ['analytics', 'functional', 'advertisement'].
domainsApplied
array
Required. The domains for which this consent allows these preferences to persist to.
gdprApplies
boolean
Optional. Determine if GDPR applies based on the user's geo-location.
Warehouse query
sql
select
unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'consent_preferences'
and events.event_vendor = 'com.snowplowanalytics.snowplow'

cmp_visible

Event
Tracks the load time of Consent Management Platform (CMP) banners.
Schema URIiglu:com.snowplowanalytics.snowplow/cmp_visible/jsonschema/1-0-0
Example
json
{
"elapsedTime": 1.5
}
Properties and schema
PropertyDescription
elapsedTime
number
Required. The time taken for the consent popup to be shown to the screen.
Warehouse query
sql
select
unstruct_event_com_snowplowanalytics_snowplow_cmp_visible_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'cmp_visible'
and events.event_vendor = 'com.snowplowanalytics.snowplow'

Basic

When you track a consent_granted or consent_withdrawn event, the tracker will automatically create and attach a consent_document entity.

The native mobile and Flutter trackers also support automatic addition of the gdpr entity to all tracked events. To configure this, provide a GdprConfiguration object when setting up a new tracker.

The React Native tracker did include GDPR entity configuration in earlier versions. We deprecated it in version 4.

consent_granted

Schema
Schema for consent granted
Schema URIiglu:com.snowplowanalytics.snowplow/consent_granted/jsonschema/1-0-0
Properties and schema
PropertyDescription
expiry
string
Optional.

consent_withdrawn

Schema
Schema for consent withdrawn
Schema URIiglu:com.snowplowanalytics.snowplow/consent_withdrawn/jsonschema/1-0-0
Properties and schema
PropertyDescription
all
boolean
Required.

consent_document

Schema
Schema for consent document context
Schema URIiglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0
Properties and schema
PropertyDescription
id
string
Required.
version
string
Required.
name
string
Optional.
description
string
Optional.

gdpr

Schema
Schema for a web page context
Schema URIiglu:com.snowplowanalytics.snowplow/gdpr/jsonschema/1-0-0
Properties and schema
PropertyDescription
basisForProcessing
string
Required. GDPR basis for data collection & processing
Must be one of: consent, contract, legal_obligation, vital_interests, public_task, legitimate_interests
documentId
string
Optional. ID for document detailing basis for processing
documentVersion
string
Optional. Version of document detailing basis for processing
documentDescription
string
Optional. Description of document detailing basis for processing

On this page

Want to see a custom demo?

Our technical experts are here to help.