|
| 1 | +--- |
| 2 | +title: Consent Management Overview |
| 3 | +hidden: true |
| 4 | +related: |
| 5 | + - "/privacy/account-deletion/" |
| 6 | + - "/privacy/complying-with-the-gdpr/" |
| 7 | +--- |
| 8 | +> info "Consent Management is in private beta" |
| 9 | +> This means that Consent Management features are in active development, and some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions. |
| 10 | +
|
| 11 | +When an end user visits your site, they set **consent preferences**, or make decisions about the types of data they want you to collect, use, and share. These consent preferences are typically presented as a set list of categories that describe how your company intends to use that data. Common categories include personalization, advertising, and site performance. |
| 12 | + |
| 13 | +Segment works with your third-party consent management platform (CMP) or bespoke consent solution to capture an end user's consent preferences and enforce those preferences by only routing events to the categories consented to by an end user. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +After a user sets their consent preferences, Segment captures them with the [Analytics.js Consent Tools wrapper](https://github.com/segmentio/analytics-next/tree/master/packages/consent/consent-tools) and updates the [consent object](#consent-object). The events are then sent downstream to any streaming destinations in categories that a user consented to share data with. |
| 18 | + |
| 19 | +> info "" |
| 20 | +> Segment collects consent for both registered users and anonymous users. |
| 21 | +
|
| 22 | +## Enforce consent |
| 23 | +Segment routes events with a consent object to the destinations in categories consented to by a user and to destinations that do not have a consent category. |
| 24 | + |
| 25 | +If an end user changes the categories they consent to (or if they consent using a different device or identifier,) any events they generate after updating their consent preferences will contain the updated consent information. Segment only sends events to the destinations in the categories that are currently consented to. |
| 26 | + |
| 27 | +> warning "Segment recommends mapping all destinations to a category" |
| 28 | +> Segment assumes any destinations without a mapping do not require user consent and will receive all events containing a consent object. |
| 29 | +
|
| 30 | + |
| 31 | +<!--- out of scope for Q2: For example, if a user agreed to share their information with you for all categories on their first visit to your site, and then on their next visit to the site only consented to sharing data for functional and advertising purposes but not for analytics or data sharing, a [Track call](/docs/connections/spec/track/) demonstrating their new consent preferences would have the following format: |
| 32 | +
|
| 33 | +``` json |
| 34 | +{ |
| 35 | + "anonymousId": "23adfd82-aa0f-45a7-a756-24f2a7a4c895", |
| 36 | + "type": "track", |
| 37 | + "event": "Segment Consent Preference", |
| 38 | + "userId": "u123", |
| 39 | + "traits": { |
| 40 | + |
| 41 | + "phone": "555-555-5555", |
| 42 | + } |
| 43 | + "timestamp": "2023-01-01T00:00:00.000Z", |
| 44 | + "context": { |
| 45 | + "consent": { |
| 46 | + "consentPreferences" : { |
| 47 | + "Advertising": true, |
| 48 | + "Analytics": false, |
| 49 | + "Functional": true, |
| 50 | + "DataSharing": false |
| 51 | +} |
| 52 | + } |
| 53 | + } |
| 54 | +} |
| 55 | +``` |
| 56 | +
|
| 57 | +> info "Segment Consent Preference is a reserved event name" |
| 58 | +> Segment has standardized a series of reserved event names that have special semantic meaning and maps these events to tools that support them. |
| 59 | +> |
| 60 | +> See the [Semantic Events](/docs/connections/spec/semantic/) docs for more details. |
| 61 | +
|
| 62 | +---> |
| 63 | + |
| 64 | +To learn more about configuring consent categories in your workspace, see the [Configure Consent Management documentation](/docs/privacy/configure-consent-management/). |
| 65 | + |
| 66 | +## Consent object |
| 67 | + |
| 68 | +Segment requires every event from all of your sources to include the end-user consent preferences, captured by your consent management tools or your application logic, in the form of the **consent object**. The consent object is a JSON object with the following format: |
| 69 | + |
| 70 | +```json |
| 71 | +{ |
| 72 | +"context": { |
| 73 | + "consent": { |
| 74 | + "consentPreferences": { |
| 75 | + "Advertising": true, |
| 76 | + "Analytics": false, |
| 77 | + "Functional": true, |
| 78 | + "DataSharing": false |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | +} |
| 83 | + |
| 84 | +``` |
| 85 | +<!--- Q3 scope: |
| 86 | +
|
| 87 | +### Consent policy version |
| 88 | +
|
| 89 | +add to snippet above:" "version": 1," |
| 90 | +
|
| 91 | +Segment assigns a `version` to your consent object. The `version` describes the version of Segment's consent schema that message used. |
| 92 | +
|
| 93 | +A consent conflict flag and the categories consented to by a user are both pulled from the consent object and are visible as traits on a user's profile in Unify. ---> |
| 94 | + |
| 95 | + |
| 96 | +## Reconcile consent conflicts |
| 97 | + |
| 98 | +Segment resolves conflicts between your [consent object and your integration object](#reconcile-consent-object-and-integrations-object-conflicts) and between your [CMP and the consent categories you configured in the Segment app](#reconcile-cmp-and-segment-consent-category-conflicts). |
| 99 | + |
| 100 | +### Reconcile consent object and integrations object conflicts |
| 101 | + |
| 102 | +You can add both the integrations object and the consent object to your Segment payloads for greater control over how Segment routes data to your downstream destinations. |
| 103 | + |
| 104 | +> success " " |
| 105 | +> For more information about the Integrations object, please see [Filtering your Segment Data](/docs/guides/filtering-data/#filtering-with-the-integrations-object). |
| 106 | +
|
| 107 | +If an event includes both an integrations and consent object, Segment will look at the consent object first, and then take into account the integrations object according to the following table: |
| 108 | + |
| 109 | +| Consent Object | Integration Object | Result | |
| 110 | +| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ------ | |
| 111 | +| Not provided <br><br> `"context": {` <br>`}` | Not provided or empty object | Data flows to all destinations | |
| 112 | +| Empty consent object <br><br> `"context": {`<br>` "consent": {`<br>` }`<br>`}` <br> OR <br> `"context": {`<br>` "consent": {`<br>` "categoryPreference": {` <br>` }`<br>` }` <br> `}`| Not provided or empty object | Data does **NOT** flow to any mapped destinations - consent is considered to be `false` for all categories. <br> <br> Data flows to all destinations **NOT** mapped to a consent category. | |
| 113 | +| Not provided <br><br> `"context": {` <br>`}` | `{facebook: true,`<br>`amplitude: false}` | Data flows to the destinations that are `true` in the integrations object (Facebook). Any metadata provided in the integrations object also flows to your downstream destinations. | |
| 114 | +| Empty consent object <br><br> `"context": {`<br>` "consent": {`<br>` }`<br>`}` <br> OR <br> `"context": {`<br>` "consent": {`<br>` "categoryPreference": {` <br>` }`<br>` }` <br> `}`| `{facebook: true,`<br>`amplitude: false}` | Data does **NOT** flow to any mapped destinations - consent is considered to be `false` for all categories. <br><br> Data flows to all destinations **NOT** mapped to a consent category, destinations set to `true` in the integrations object, and destinations not included in the integrations object. | |
| 115 | +| `{ad: true,` <br>`analytics: false}`<br> <br>_Segment has no category-to-destination mapping for ad and analytics_ | Provided, not provided, or empty object | Data flows to all destinations, as all destinations are unmapped. If the integrations object is present, data flow may be impacted. | |
| 116 | +| `{ad: true,` <br>`analytics: false}`<br> <br>_ad = facebook, google-ads_ <br> | Not provided or empty object | Data flows to destinations that map to a consented purpose. In this case, data flows to all ad destinations (Facebook and Google Ads).<br><br> No data flows to analytics destinations. | |
| 117 | +| `{ad: true,` <br>`analytics: false}`<br><br>_ad = facebook, google-ads_ <br> _analytics = amplitude_ | `{facebook: true,`<br>`amplitude: false}` | Data flows to all ad destinations, even though Google Ads is not present in the integrations object.<br><br> Data does **NOT** flow to analytics destinations. | |
| 118 | +| `{ad: true,` <br>`analytics: false}`<br><br>_ad = facebook, google-ads_ <br> _analytics = amplitude_ | `{facebook: false,`<br>`amplitude: false}` | Data only flows to Google Ads and not to Facebook, which is `false` in the integrations object. <br><br> Data does **NOT** flow to analytics destinations. | |
| 119 | +| `{ad: true,` <br>`analytics: false}`<br><br>_ad = facebook, google-ads_ <br> _analytics = facebook, amplitude_ | `{facebook: true,`<br>`amplitude: false}` | When destinations are mapped to multiple categories, data only flows if consent is `true` for all categories. In this case, data only flows to Google Ads and not to Facebook. <br><br>Data does **NOT** flow to analytics destinations. | |
| 120 | +| `{ad: true,` <br>`analytics: true}`<br><br>_ad = facebook, google-ads_ <br> _analytics = facebook, amplitude_ | `{facebook: true,`<br>`amplitude: false}` | When destinations are mapped to multiple categories, data only flows if consent is `true` for all categories. In this case, data flows to Google Ads and Facebook. No data flows to Amplitude because it is `false` in the integrations object. | |
| 121 | +| `{ad: false,` <br>`analytics: true}` <br><br>_ad = facebook, google-ads_ <br> _analytics = facebook, amplitude_ | `{facebook: true,`<br>`amplitude: false}` | When destinations are mapped to multiple categories, data only flows if consent is `true` for all categories. <br><br>In this example, data does **NOT** flow to any destination because of the interaction between the integrations and consent objects. | |
| 122 | + |
| 123 | +### Reconcile CMP and Segment consent category conflicts |
| 124 | + |
| 125 | +If you have a category configured in your consent management tool (for example, `advertising`) and there is no category with the same ID in Segment, the data will flow to unmapped destinations. If destinations are mapped to a different category in the Segment app, data flow will honor end user consent for that category. |
| 126 | + |
| 127 | +If there is a category configured in Segment (`functional`) that is not mapped in your CMP, data will not flow to destinations mapped to the `functional` category. |
| 128 | + |
| 129 | +## Consent observability |
| 130 | + |
| 131 | +<!--- You can view consent preference events in your [Tracking Plan](/docs/protocols/tracking-plan/create/) and view discarded events in [Delivery Overview](/docs/connections/delivery-overview/). ---> |
| 132 | +<!---### Tracking Plan |
| 133 | +### Delivery Overview |
| 134 | +out of current scope---> |
| 135 | +Events discarded due to consent preferences appear in [Delivery Overview](/docs/connections/delivery-overview/) at the "Filtered at destination" step with the discard reason __Filtered by end user consent__. |
0 commit comments