diff --git a/.changeset/big-coins-sparkle.md b/.changeset/big-coins-sparkle.md new file mode 100644 index 000000000..18d31694d --- /dev/null +++ b/.changeset/big-coins-sparkle.md @@ -0,0 +1,5 @@ +--- +'@segment/analytics-consent-wrapper-onetrust': patch +--- + +Require category IDs for OneTrust mapping (e.g CAT0002, SEG0003), and do not accept category name any more. Reason: documentation is easier, and Segment currently has a 20 char limit on category IDs. diff --git a/packages/consent/consent-wrapper-onetrust/README.md b/packages/consent/consent-wrapper-onetrust/README.md index 6b4dec3ec..bac815f3c 100644 --- a/packages/consent/consent-wrapper-onetrust/README.md +++ b/packages/consent/consent-wrapper-onetrust/README.md @@ -3,8 +3,23 @@ This package is for the OneTrust integration for analytics consent # Quick Start +## Configure OneTrust + Segment +### Ensure that the OneTrust Banner SDK is loaded first +```html + + + +``` + +### Ensure that consent is enabled and that you have created your Integration -> Consent Category Mappings +- Ensure that your integrations in the Segment UI have consent enabled, and that they map to your Consent Category IDs (also called Cookie Group IDs or Cookie Consent IDs). +The IDs look like "CAT0001", "CAT0002"and are configurable in OneTrust +![onetrust category ids](img/onetrust-cat-id.jpg) -## Install dependency +- Debugging: this library expects the [OneTrust Banner SDK](https://community.cookiepro.com/s/article/UUID-d8291f61-aa31-813a-ef16-3f6dec73d643?language=en_US) to be available in order interact with OneTrust. This library derives the group IDs that are active for the current user from the `window.OneTrustActiveGroups` object provided by the OneTrust SDK. [Read this for more information [community.cookiepro.com]](https://community.cookiepro.com/s/article/UUID-66bcaaf1-c7ca-5f32-6760-c75a1337c226?language=en_US). + +## Install dependency ```sh npm install @segment/analytics-consent-wrapper-onetrust @@ -16,8 +31,8 @@ yarn add @segment/analytics-consent-wrapper-onetrust ## For `npm` library users +- Use the following initialization code -- Use the following initialization code ```ts import { oneTrust } from '@segment/analytics-consent-wrapper-onetrust' import { AnalyticsBrowser } from '@segment/analytics-next' @@ -30,7 +45,7 @@ analytics.load({ writeKey: ' }) ``` ## For snippet users (window.analytics) who _also_ use a bundler like webpack -### *NOTE:* a pre-bundled version that can be loaded through a `