CookieConsent v3 Logging
Use the CookieConsent v3 Logging extension to capture user consent decisions and send them to a configurable endpoint.
Use this extension to log user consent decisions collected through the CookieConsent v3 interface. It captures relevant information such as the consent ID, accepted categories, and the consent model, then sends this data as a JSON payload to your endpoint using the fetch()
API. You can configure the payload to match your system’s requirements, whether you are sending to the Tealium Collect endpoint or a custom destination.
Requirements
The CookieConsent v3 Logging extension requires the Manage JavaScript Code Extensions permission.
How it works
This extension listens for consent_updated
events from the CookieConsent interface. When a user makes or updates a consent decision, the extension retrieves the consent state and sends the information as a JSON payload to a specified endpoint using the fetch()
method.
The payload typically includes:
tealium_event
: The event type, such asconsent_decision
.consent_id
: Unique identifier for the user’s consent decision.decision_type
: Whether the user accepted or rejected categories.accepted_purposes
andrejected_purposes
: The categories selected by the user.consent_model
: Eitheropt-in
oropt-out
.url
: The current page URL without query parameters.decision_timestamp
: The time the consent was last updated.expiration_time
: How long the consent is valid.revision
: The current version of the consent configuration.tealium_account
andtealium_profile
: Where the event should be sent.tealium_visitor_id
: (Optional) Included if already available in theutag_main
cookie.
You can adjust this payload to suit your endpoint or data model.
How to configure
- In Tealium iQ, go to Extensions and click Add Extension.
- Click the Privacy tab.
- Click + Add next to the CookieConsent v3 Logging extension.
- Enter a Title for the extension.
- Under Scope, use the default option DOM Ready. It supports load conditions, which lets you control when the extension runs. The Preloader scope is also supported but doesn’t allow load conditions.
- (Optional) Click Add Condition to apply load conditions for this extension. Ensure the conditions match your consent integration’s enforcement rules to avoid issues.
- In the Configuration code do one of the following:
- If you’re sending logs to Tealium Collect, replace the placeholder values for
tealium_account
andtealium_profile
with your actual values. - If you’re sending logs to a different endpoint, update the
fetch()
URL to the destination you want to send the consent logs.
- If you’re sending logs to Tealium Collect, replace the placeholder values for
This page was last updated: July 9, 2025