Osano Segment Wrapper
This page details how to implement and use the Osano Segment Wrapper which utilizes Segement's analytics-consent-tools.
Requirements
- ⚠️ Osano CMP script - the Osano Segment Wrapper utilizes the Osano CMP JavaScript API for various functions. If the wrapper cannot detect the Osano CMP script on the website or access the CMP JavaScript API, then the wrapper will not load Segment.
Implementation Details
-
Ensure that your Osano Cookie Consent configuration version is updated to
2025.8.1
or later.- You can check your configuration's version by using the CMP JavaScript API
cmpVersion
property - To update to the latest CMP version, re-publish your Cookie Consent configuration.
- You can check your configuration's version by using the CMP JavaScript API
-
In Segment, create your consent categories. Instructions on how to create consent categories can be found here.
-
⚠️ IMPORTANT: The Osano Segment Wrapper maps the Osano consent categories to the following Category IDs. Use the matching Category ID when you create your Segment consent categories.
Osano Consent Category Category ID MARKETING Advertising ANALYTICS Analytics ESSENTIAL Essential PERSONALIZATION Personalization OPT_OUT (For IAB CCPA framework) SaleOrShare STORAGE (For IAB TCF 2.0 framework) Storage
-
-
Add Osano Segment Wrapper script to your site after the Osano CMP osano.js script:
<script src="https://cmp.osano.com/osano.segment.js"></script>
-
After you've created the Segment Source, copy the Segment snippet from your Segment Source and add that to your site after the Osano Segment Wrapper script.
- Locate & replace
analytics.load("<YOUR_WRITE_KEY>")
withwithCMP(analytics).load("<YOUR_WRITE_KEY>")
- The Segment snippet can be found during Step 2: Connect of the Source setup flow or in the details view of an existing Source.
- Locate & replace
-
Verify in Segment that Segment events are being sent to Segment and that the events contain the Consent Object. Instructions on how to validate the events and event data can be found here.