IntegrationsCDPSegment (as destination)

Segment (as destination)

If you already have a CDP, Signal can be its first-party collector. This integration forwards events from Signal into your existing Segment workspace as an HTTP Source so Segment’s destination fan-out continues unchanged, while Signal replaces the browser SDK with a first-party server-side collector on your own domain.

Signal is not a replacement for Segment. Segment remains your downstream activation and routing layer; Signal sits in front of it as the upstream first-party collector. Use this integration if you already run Segment and want first-party collection without disturbing existing destinations.

Prerequisites

  • A Segment workspace.
  • An HTTP API Source configured in that workspace.
  • The source write key.
  • Knowledge of whether your workspace is in the US or EU region (this determines the endpoint).

Get your credentials

Create or locate an HTTP API source

In the Segment dashboard, open Connections > Sources and either select an existing HTTP API source or click Add Source > HTTP API to create one.

Copy your write key

Open the source and copy the Write Key from Settings > API Keys. This is a secret — treat it like a password.

Confirm your region

Workspaces created in the EU stack use https://events.eu1.segmentapis.com/v1 instead of the default https://api.segment.io/v1. The Workspace Settings page in Segment shows the region.

Configure in Signal

Configuration fields

FieldRequiredDescription
write_keyYesSegment HTTP API source write key. Stored as a secret.
endpointNoDefault https://api.segment.io/v1. Override to https://events.eu1.segmentapis.com/v1 for EU workspaces.

Management UI setup

  1. Go to Integrations > Add Integration > Segment (as destination).
  2. Enter your write_key.
  3. If your workspace is in the EU, override the endpoint to the EU URL.
  4. Select the General preset.
  5. Choose consent categories (default: analytics).
  6. Save and enable.

Management API setup

curl -X POST https://api.example.com/v1/admin/integrations \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "source_id": "src_abc123",
    "vendor": "segment_destination",
    "name": "Segment Production",
    "enabled": true,
    "config": {
      "write_key": "your_write_key",
      "endpoint": "https://api.segment.io/v1"
    },
    "consent_categories": ["analytics"]
  }'

API endpoint

POST {endpoint}/track
Authorization: Basic {base64(write_key:)}

Other Segment event types share the same base path on their canonical sub-paths (/identify, /page, /group, /batch). The default Signal preset targets /track; pipelines can override per event type if needed.

Event mapping

Signal’s canonical event model was designed to be Segment-compatible, so this is a near-pure pass-through.

Signal eventSegment eventEndpoint path
pagepage/page
identifyidentify/identify
groupgroup/group
Order Completed (or any track event)Order Completed (name preserved)/track

Properties pass through to Segment’s properties object. Traits set via datafly.identify() pass through to traits.

Example: Order Completed

Signal call:

datafly.track("Order Completed", {
  order_id: "ORD-001",
  total: 129.99,
  currency: "USD",
  products: [
    { product_id: "SKU-A", name: "Widget", price: 49.99, quantity: 2 }
  ]
});

Payload sent to Segment:

{
  "type": "track",
  "event": "Order Completed",
  "anonymousId": "anon_a1b2c3",
  "userId": "user_42",
  "messageId": "evt_abc123",
  "timestamp": "2026-05-12T10:00:00.000Z",
  "context": {
    "ip": "203.0.113.50",
    "userAgent": "Mozilla/5.0 ...",
    "page": { "url": "https://example.com/checkout/confirmation" },
    "library": { "name": "datafly.js", "version": "1.0.0" }
  },
  "properties": {
    "order_id": "ORD-001",
    "total": 129.99,
    "currency": "USD",
    "products": [
      { "product_id": "SKU-A", "name": "Widget", "price": 49.99, "quantity": 2 }
    ]
  }
}

Identity

Signal fieldSegment field
anonymous_idanonymousId
user_iduserId
event_idmessageId
context.ipcontext.ip
context.user_agentcontext.userAgent
context.pagecontext.page
context.campaigncontext.campaign
context.librarycontext.library

Signal generates a stable first-party anonymous_id and forwards it to Segment as anonymousId. When datafly.identify() is called, the same userId arrives at Segment on subsequent events.

The default consent category for this integration is analytics. Events are only forwarded when the visitor has granted analytics consent.

Override the category list in the integration config if you need to gate delivery on a different category.

Verify

Trigger an event

Call:

datafly.track("Test Event", { source: "signal-verify" });

Check the Source Debugger

In Segment, open Connections > Sources > your HTTP source > Debugger. The event should appear within seconds. Confirm:

  • event name matches what Signal sent
  • anonymousId is populated
  • properties contains the expected payload

Confirm downstream delivery

Open one of your downstream Segment destinations and confirm the event reached it — this validates that Signal-collected events fan out exactly as Segment’s own SDK-collected events do.

Troubleshooting

ProblemSolution
401 from SegmentWrite key is wrong, revoked, or attached to a different source. Regenerate and update the integration config.
404 from SegmentThe endpoint is wrong — most commonly an EU workspace pointed at the US endpoint. Switch to https://events.eu1.segmentapis.com/v1.
Events accepted but not visible in DebuggerThe HTTP source is disabled, or you’re looking at a different source’s debugger. Confirm the write key matches the source you’re viewing.
Events appear in Segment but not in a destinationIssue is downstream of Signal — check the destination configuration in the Segment dashboard.
userId is missingdatafly.identify() has not yet been called for the visitor. Verify identify is wired into your login / form-submit flow.

See also