Skip to main content
Optimizely → SegmentIntegration guide

Connecting Optimizely to Segment

Optimizely deliberately shows different people different experiences, which means every conversion figure your ad platform reports is an average across variants it knows nothing about. Segment is a customer data platform rather than an ad network, so sending to it is not about matching a conversion — it is about putting one clean event where every other destination can read it. The join between them succeeds or fails on one thing: whether the userId and anonymousId reaches the Optimizely variant assignment before the conversion happens, because Segment can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Optimizely to Segment: Experiment Viewed events for every tool

Segment's A/B testing spec defines an Experiment Viewed event with experiment and variation IDs and names, which Segment's Optimizely Web integration can emit. Alias the anonymousId of the exposure to the userId on later server orders, send IDs as well as names, route Experiment Viewed only to warehouse and analytics destinations, and carry the variation ID on Order Completed.

Segment's A/B testing spec defines an Experiment Viewed event with experiment and variation IDs and names, and Segment's Optimizely Web integration can emit it. Check which direction your setup runs, because forwarding Segment events into Optimizely and sending Optimizely decisions into Segment are configured separately. Once Experiment Viewed lands on the right anonymousId, every downstream tool gets the variant without a separate integration for each.

The exposure happens anonymously; the order usually happens later, often server-side with a userId. Unless the anonymousId is aliased to that userId, your warehouse and analytics tools see the exposure and the purchase on two different people, and every per-variant number is wrong. Send variation IDs as well as names, because names get edited mid-test and break joins.

Segment fans out, so decide where variant data should not go. Ad destinations generally cannot use a variant, and mapping Experiment Viewed to them can create custom events nobody asked for, or, if mapped carelessly, a conversion. Route it to the warehouse and analytics destinations only, and carry the variation ID as a property on Order Completed as well, so ad-platform conversions can still be split by variant in the warehouse.

Optimizely → Segment · what breaks

Why this join usually fails — Optimizely → Segment

  1. 01

    The userId and anonymousId never reaches Optimizely

    Client-side experiments can flicker and can delay rendering, which loses landing-page identifier capture on slow connections — a bias that falls unevenly across variants.

  2. 02

    An experiment silently confounding every campaign result

    A test that moves conversion rate by fifteen percent will move every campaign's measured performance by some fraction of that, and the media team will attribute it to bidding, creative or seasonality. Anything but the test.

  3. 03

    One bad event multiplied across every destination

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  4. 04

    Nothing reconciles afterwards

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Optimizely → Segment · the fix

What working looks like — Optimizely → Segment

  • The userId and anonymousId on every assignment

  • Conversions arriving in Segment

    Events land in Segment and forward to every connected destination, warehouse included, on one shared definition.

  • Reconciled against the source

Optimizely → Segment · architecture

How Optimizely and Segment actually connect

  1. 1

    Optimizely holds the truth

    The variant is the missing dimension. Without it, a campaign's performance is confounded by an experiment nobody told the media team about, and both teams will draw confident, wrong conclusions.

  2. 2

    Segment needs a click to match

    Segment needs a consistent identity model — the same userId everywhere, an alias when an anonymous visitor becomes known, and event names that follow one spec. Feeding it inconsistent identities pushes the mess to every connected destination at once.

  3. 3

    The identifier is the bridge

    The userId and anonymousId, captured at the visit and carried into the Optimizely variant assignment.

  4. 4

    The event source decides reliability

    Send purchases with the variant as a custom dimension, so campaign performance can be read per variant rather than blended.

  5. 5

    Deduplication at the destination

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

Optimizely → Segment · normal or broken

Working vs. broken, side by side — Optimizely → Segment

Normal, not a fault

  • The userId and anonymousId present on the assignment

  • Sent from your order system with variant attached

  • Deduplicated correctly

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

  • Reconciles with the source

Actually broken

  • The userId and anonymousId missing on most records

    Client-side experiments can flicker and can delay rendering, which loses landing-page identifier capture on slow connections — a bias that falls unevenly across variants.

  • Sent from the browser

    A test that moves conversion rate by fifteen percent will move every campaign's measured performance by some fraction of that, and the media team will attribute it to bidding, creative or seasonality. Anything but the test.

  • Counted twice, or not at all

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  • Nobody has reconciled it

Optimizely → Segment · diagnose

Diagnostic order — Optimizely → Segment

  1. 01

    Count assignments carrying the userId and anonymousId

  2. 02

    Follow one real conversion end to end

  3. 03

    Check for running experiments before diagnosing a performance change

    First question, not last. It costs one minute and explains a surprising share of unexplained movements.

  4. 04

    Check identity resolution before checking anything downstream

    If anonymousId is never aliased to userId, every destination sees two people where there is one, and no downstream fix helps.

  5. 05

    Read the match rate, not the success message

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Optimizely → Segment · prove

How it gets proven — Optimizely → Segment

Source of truth

Your order system, joined to the variant each customer was assigned.

  • The userId and anonymousId confirmed present on a live assignment.
  • An anonymous session confirmed aliased to a known user, with the event visible in at least one downstream destination.
  • Orders reconciled per variant against imported conversions over the full experiment window.

Optimizely → Segment · free audit

What we check in the free audit

  • Count assignments carrying the userId and anonymousId
  • Follow one real conversion end to end
  • Check for running experiments before diagnosing a performance change
  • Check identity resolution before checking anything downstream
  • Read the match rate, not the success message

Checked against

Your order system, joined to the variant each customer was assigned.

Get my free conversion tracking audit

Free30 minutesNo obligation

Optimizely → Segment · when not to buy

When you don't need this — Optimizely → Segment

  • Measure identifier coverage yourself first — pull your last hundred assignments and count how many carry the userId and anonymousId.
  • If you are not running experiments on pages in the paid funnel, there is no confound and nothing to integrate.
  • If you send to one or two destinations, Segment is infrastructure you do not need — direct integrations are simpler and cheaper. It earns its place at genuine fan-out.

Optimizely → Segment · what we deliver

What gets built — Optimizely → Segment

  • Identifier capture into Optimizely

    Capture the identifier before the experiment framework initializes, and pass the variant assignment as a dimension alongside it.

  • Event source: your order system with variant attached

    Send purchases with the variant as a custom dimension, so campaign performance can be read per variant rather than blended.

  • Dispatch to Segment

    Server-side track and identify calls with a stable messageId, consistent userId, and the click identifier carried as a trait or property.

  • Reversals where they exist

    Refunds reverse and should retain the variant dimension.

Written guarantee

95%+ tracking accuracy

Measured against Your order system, joined to the variant each customer was assigned.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Optimizely → Segment questions, answered

Enable the integration that emits Experiment Viewed events into Segment, or track them yourself with experiment and variation IDs per Segment's A/B testing spec. The integrations in each direction are set up separately, so check yours.

Free · 30 min

Get Optimizely and Segment joined properly

Free30 minutesNo obligation