Skip to main content

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

  1. 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.
  2. 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 CategoryCategory ID
      MARKETINGAdvertising
      ANALYTICSAnalytics
      ESSENTIALEssential
      PERSONALIZATIONPersonalization
      OPT_OUT (For IAB CCPA framework)SaleOrShare
      STORAGE (For IAB TCF 2.0 framework)Storage

    Segment Consent Management Segment Consent Category setup flow

  3. 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>

  4. 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>") with withCMP(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. Segment snippet during Source setup flow Segment Source
  5. 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.