This example shows you how to give your users a simple “Opt-in/Opt-out” option. If the user consents, they are automatically opted-in to all tracking categories. If they revoke their consent, no categories are active, and no tracking calls are sent.
Define and call the following method in your Tealium Helper class when your app user consents to or declines tracking. If the user consents to tracking, the Consent Manager automatically opts them in to all tracking categories.
This example shows a category-based consent model, where tracking categories are grouped into a smaller number of higher-level categories, defined by you. For example, you may choose to group the Tealium consent categories "analytics", "monitoring", "big_data", "mobile", and "crm" under a single category called "performance". This may be easier for the user than selecting from the full list of categories. You may choose to represent this in a slider interface, ranging from least-permissive to most-permissive (all categories).
This example shows a category-based consent model where the user must explicitly select each category from the full list of categories. The default state of the Consent Manager is "Unknown", which queues hits until the user provides their consent. If the user consents to any category, events are dequeued, and the consented category data is appended to each tracking call.
This code shows how to enable Consent Management on Tealium initialization.
Returns the complete list of supported consent categories.
Sets the initial consent status for the user when the library starts up for the first time. If there are saved preferences, they override any preferences passed in the config object.
Consent Manager always sets the list of consented categories to include ALL available consent categories, if the status is Consented. This method does not allow categories to be set selectively.
Sets the user’s initial consent status when the library starts up for the first time. If there are saved preferences, these override any preferences passed in the config object.
self.configuration.userConsentStatus = Consented;
A value from TEALConsentStatus enum
[Consented, NotConsented, Disabled]
Sets the user’s initial consent categories when the library starts up for the first time. If there are saved preferences, these override any preferences passed in the config object.