Integrate Segment (Legacy)

  • Updated
This is a legacy integration. For the new Twilio Segment integration, see Integrate Twilio Segment.

The Optimizely Data Platform (ODP)-Segment integration lets you import events and other customer data collected in Segment to ODP. 

Configure Segment

Enable the ODP-Segment integration:

  1. Go to Account Settings >Integrations > Segment.
  2. Toggle on Enable Segment.
  3. Select Sign In and follow the prompts in Segment.


If you have any ad-blocking or content-blocking software installed on your browser, you may not see the option to Sign In. If you do not see it, please turn off your blocking technology and refresh the page.

Data details

ODP uses the following event types from along with the standard fields associated with each event type to automatically create the corresponding ODP events.

Below is a table outlining the common fields from and the corresponding field in the ODP event.

Segment Field ODP Field
anonymousID segment_anonymous_id
userID segment_user_id 
timestamp  ts
context.locale language page
context.referrer.url referrer search_term title hostname
context.ip ip
context.user_agent ua
context.timezone timezone campaign
context.campaign.source source
context.campaign.medium medium
context.campaign.term keywords
context.campaign.content content


Identify tracks anonymous users with the Segment anonymousId. As soon as users become identified with an email address or another customer ID, Segment merges this data set with anonymous activity automatically. ODP uses the same approach, and the Segment integration brings these two data sets together.

Segment also has the following standard fields for an identify event, and ODP maps them to a corresponding field.

Segment Field ODP Field
traits.firstName first_name
traits.lastName last_name name email
traits.address.county country
traits.address.state state city
traits.address.postalCode zip
traits.address.street street1
traits.avatar image_url phone
traits.gender gender

ODP applies any other field found in Segment's identify event as a custom field.


ODP can process any Segment track events and properties. Additionally, ODP has implemented the following special semantic events whose structure you can view on Segment's site:

These semantic events correspond to specific ODP event_type and action pairs found on standard ODP events. Below is a table detailing each Segment semantic event to the ODP event_type and action.

Segment Event ODP Event Type ODP Action
Products Searched navigation search
Product List Viewed navigation list
Product List Filtered navigation filter
Promotion Viewed promotion view
Promotion Clicked promotion click
Product Clicked product click
Product Viewed product detail
Product Added / Removed product add_to_cart/ remove_from_cart
Cart Viewed cart view
Checkout Started checkout start
Checkout Step Viewed checkout step_view
Checkout Step Completed checkout step_complete
Payment Info Entered checkout payment_info_enter
Order Completed order purchase
Order Updated order purchase
Order Refunded order refund
Order Cancelled order cancel
Coupon Entered checkout coupon_enter
Coupon Applied checkout coupon_apply
Coupon Denied checkout coupon_deny
Coupon Removed checkout coupon_remove
Product Added to Wishlist / Product Removed from Wishlist product add_to_wishlist/ remove_from_wishlist
Product Shared product share
Cart Shared cart share
Product Reviewed product review
Email Bounced email soft_bounce
Email Opened email open
Email Link Clicked email click
Email Marked as Spam email spamreport
Unsubscribed email unsubscribe
Viewed Product Category navigation category
Viewed Product product detail
Added / Removed Product product add_to_cart/ remove_from_cart
Completed Order order purchase

Track events not listed

If the Segment event does not fit into one of the provided semantics, ODP will map the event as:

  • Event Type: "track"
  • Action: "Your Event"

Segment events that correspond to the ODP event type order have special properties that correspond to ODP Fields.

Segment Field ODP Field
properties.order_id order.order_id order.order_total
properties.revenue order.order_subtotal order.order_discount order.order_tax order.coupon_code

The order event properties may also list fields for each product. Below is a list of Segment product properties for an order and the corresponding ODP field.

Segment Field ODP Field
properties.products.$.id order.items.$.product_id
properties.products.$.product_id order.items.$.product_id
properties.products.$.sku order.items.$.sku
properties.products.$.price order.items.$.item_price
properties.products.$.quantity order.items.$.item_quantity
N/A order.items.$.item_subtotal*

Order Item Subtotal

Segment does not provide any field for subtotal per item in a given order. ODP calculates this field as order_item.price * order_item.quantity.


Segment page events show up in ODP as pageview event types. Below is a list of the standard segment fields for a page event and the corresponding ODP fields.

Segment Field ODP Field
properties.path page name
properties.referrer referrer search_term
properties.title title


The standard fields for all Segment events are mapped to ODP fields for email events.

If you are already integrating an email service provider (ESP) directly, you do not need to send semantic events for email as those are captured directly from the ESP.

Custom Field Support

ODP supports custom fields in Segment events. You must place custom fields in either the traits or properties objects for a given Segment event.

Example: event (Note the "myCustomField" key in the properties object)

  "anonymousId": "23adfd82-aa0f-45a7-a756-24f2a7a4c895",
  "context": {
    "library": {
      "name": "analytics.js",
      "version": "2.11.1"
    "page": {
      "path": "/academy/",
      "referrer": "",
      "search": "",
      "title": "Analytics Academy",
      "url": ""
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36",
    "ip": ""
  "event": "Course Clicked",
  "integrations": {},
  "messageId": "ajs-f8ca1e4de5024d9430b3928bd8ac6b96",
  "properties": {
    "title": "Intro to Analytics",
    "myCustomField": "my_custom_field_value"
  "receivedAt": "2015-12-12T19:11:01.266Z",
  "sentAt": "2015-12-12T19:11:01.169Z",
  "timestamp": "2015-12-12T19:11:01.249Z",
  "type": "track",
  "userId": "AiUGstSDIg",
  "originalTimestamp": "2015-12-12T19:11:01.152Z"