Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Configure Consent Management


FREE x
TEAM x
BUSINESS
ADDON x

After setting up your consent management platform (CMP), you can enforce the consent collected from your users by adding the consent object to your events.

Once you've configured consent in the Segment app and updated your sources to contain consent preference in every event, your events are routed only to the categories your end users consented to share data with. Events without the consent preference will continue to flow to destinations without consent enforcement.


Prerequisites

prerequisites page anchor
(information)

Consent management edit and update capabilities limited to Workspace Owners

Only users with the Workspace Owner role are able to create, edit, and disable consent categories. All other users have read-only access to Consent Management features.

Before you can configure consent in Segment, take the following steps:

  • Set up your third-party consent management tool and create consent categories. Take note of your consent categories and the key or ID associated with each category.
  • Know how your company uses each destination. You need to know which destinations to map to each category.
  • Access to your web and mobile libraries. After you set up consent categories in the Segment app, you need to integrate your CMP and your Segment sources using a wrapper or other solution.
  • For Analytics.js sources only : Navigate to your Analytics.js source. Select Settings > Analytics.js and enable Destination Filters.

Step 2: Integrating your CMP with Segment

step-2-integrating-your-cmp-with-segment page anchor

Once you've created consent categories in the Segment app, you need to integrate your CMP with Segment and add the consent object to every event. If you're using Segment's OneTrust wrapper, the consent object automatically populates on each event. However, other methods may require you to manually include the consent object on your events.

Segment supports the following CMPs:

Consent Management PlatformSupported web librariesSupported mobile librariesContact
OneTrustAnalytics.js(link takes you to an external page)*Kotlin(link takes you to an external page)
Swift(link takes you to an external page)
React Native(link takes you to an external page)
For support and troubleshooting, contact Segment.
TrustArcAnalytics.js(link takes you to an external page)UnsupportedFor support and troubleshooting, contact TrustArc(link takes you to an external page).
KetchAnalytics.js(link takes you to an external page)UnsupportedFor support and troubleshooting, contact Ketch(link takes you to an external page).

*If you send data to device-mode destinations connected to your Analytics.js source, you must navigate to your Analytics.js source in the Segment app, select Settings > Analytics.js, and enable Destination Filters.

(success)

Success!

For more information about Segment's Analytics.js OneTrust wrapper, see the Analytics.js OneTrust Wrapper documentation.

If you'd like to integrate with any other CMP, Segment requires you to build your own wrapper or use any mechanism provided it meets the following requirements for data and event generation:

  • Reads the end user consent preference from your CMP and includes the consent object in every event
  • If using Unify or Twilio Engage, generates the Segment Consent Preference Updated event every time a user provides or updates their consent preferences with their anonymousId and userId

To get started building your own wrapper, follow the instructions in the @segment/analytics-consent-tools(link takes you to an external page) repository.

(warning)

Consent Management is not backwards compatible with Segment's legacy iOS and Android libraries

If you are using one of Segment's legacy mobile libraries (iOS or Android,) you will need to upgrade to Swift or Kotlin before using Consent Management.

Validate your CMP integration

validate-your-cmp-integration page anchor

Customers with Analytics.js 2.0 sources can use the Segment Inspector to confirm that events from their source contain the consent object. Unify and Engage users can also verify that the Segment Consent Preference Updated event emits every time end users update their consent preferences.

All users can validate that events contain the consent object and that the Segment Consent Preference Updated event is present using Segment's Source Debugger.

You can also confirm your events flow to destinations or are blocked from destinations according to the consent categories you created in Step 1: Create consent categories in the Segment App, if already connected to the destination.