Skip to main content

Segment

Server Source code Package

Server-side event delivery to Segment via the official @segment/analytics-node SDK. Implements the full Segment Spec surface (track, identify, group, page, and screen) with automatic identity deduplication and graceful shutdown via closeAndFlush().

Where this fits

Segment is a server destination in the walkerOS flow:

Receives events server-side from the collector, resolves identity and consent context, and forwards them to Segment for routing to 400+ downstream destinations.

Installation

Loading...
Loading...

Configuration

This destination uses the standard destination config wrapper (consent, data, env, id, ...). For the shared fields see destination configuration. Package-specific fields live under config.settings and are listed below.

Settings

PropertyTypeDescriptionMore
writeKey*stringSegment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.
userIdstringwalkerOS mapping value path to resolve userId from each event (like user.id).
anonymousIdstringwalkerOS mapping value path to resolve anonymousId from each event (like user.session).
hoststringBase URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.
pathstringAPI path route (like /v1/batch).
flushAtintegerEvents to enqueue before flushing a batch. Default: 15.
flushIntervalintegerMax milliseconds before auto-flush. Default: 10000.
maxRetriesintegerRetry attempts for failed batches. Default: 3.
httpRequestTimeoutintegerHTTP request timeout in milliseconds. Default: 10000.
disablebooleanCompletely disable the SDK (no-ops all calls). Default: false.
identifyanyDestination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.
groupanyDestination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.
consentRecord<string, string>Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.
integrationsRecord<string, any>Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.
* Required fields

Mapping

Per-event rules under config.mapping. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.

PropertyTypeDescriptionMore
identifyanyPer-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.
groupanyPer-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.
pageanyPer-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.
screenanyPer-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.

Examples

Anonymous only

When no userId is resolved Segment accepts a track call keyed solely by anonymousId.

Event
Out

Group company

A company update fires Segment analytics.group with groupId and group traits for account-level tracking.

Event
Mapping
Out

Consent forwarding

Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.

Event
Out

Default track

A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.

Event
Out

Destination identify

Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.

Event
Out

Renamed event

A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.

Event
Mapping
Out

Page view

A page view fires Segment analytics.page with category, name, and properties instead of a generic track.

Event
Mapping
Out

Screen view

A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.

Event
Mapping
Out

User login identify

A user login fires only Segment analytics.identify with the userId and traits, skipping the track.

Event
Mapping
Out

Identity is resolved automatically from each event: userId defaults to user.id and anonymousId defaults to user.session. At least one must be present for a call to be sent. Override these paths in settings to match your event structure.

💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)