Skip to main content

Segment

Web Source code Package

Segment is a customer data platform that routes your event data to 400+ downstream destinations (analytics, marketing, warehouses, ...). This destination forwards walkerOS events to Segment via the official @segment/analytics-next (Analytics.js 2.0) SDK, implementing the full Segment Spec surface: track, identify, group, page, and reset.

Where This Fits

Segment is a web destination in the walkerOS flow:

Loads Analytics.js, forwards events as Segment Spec calls, and automatically stamps consent context on every call.

Installation

Loading...

Setup

Loading...

Configuration reference

PropertyTypeDescriptionMore
apiKey*stringYour Segment source write key. Find it in your Segment workspace under Connections, Sources, Settings, API Keys. Maps to `writeKey` in the Analytics.js `load()` call (like a1B2c3D4e5F6a1B2c3D4e5F6a1B2c3D4).
cdnURLstringOverride the CDN URL used for settings fetch. Default: https://cdn.segment.com. Useful for self-hosted Segment proxies.
initialPageviewbooleanWhen true, the SDK fires an automatic initial page() call on load. Default: false — walkerOS sources handle page tracking, so this is disabled to avoid duplicate page views.
disableClientPersistencebooleanWhen true, prevents any cookie or localStorage writes. Useful for privacy-conscious setups. Default: false.
disableAutoISOConversionbooleanDisable automatic ISO string → Date conversion. Default: false.
retryQueuebooleanRetry failed events. Default: true.
obfuscatebooleanObfuscate event payloads. Default: false.
integrationsRecord<string, any>Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.
identifyanyDestination-level identity mapping. Resolves to an object with any of: userId, traits, anonymousId. Fires on the first push and re-fires when the resolved value changes.
groupanyDestination-level group mapping. Resolves to an object with: groupId, traits. Fires on the first push and re-fires on change.
consentRecord<string, string>Mapping from walkerOS consent keys → Segment `categoryPreferences` keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }. When omitted, walkerOS keys are forwarded 1:1 to Segment.
* Required fields

The Settings type extends Segment's InitOptions, so every passthrough option (cookie, storage, integrations, plan, retryQueue, ...) works alongside the walkerOS-specific fields above.

Mapping data.examples

tip

The code data.examples are interactive. You can edit the code to generate your individual event mapping.

Default event forwarding

Every walkerOS event becomes analytics.track(name, properties). Without include config, properties is empty. Add include: ['data'] to the destination config to forward event data as properties.

Event
Loading...
Mapping
Loading...
Result
Loading...

User login identify

Per-event identity with reserved Segment Spec traits (email, name, plan, company). skip: true suppresses the default track() call so only the identity side effect runs.

Event
Loading...
Mapping
Loading...
Result
Loading...

Group assignment

Attach a user to a company and set the company's traits in a single group() call.

Event
Loading...
Mapping
Loading...
Result
Loading...

Page views

Segment's page() is first-class. Configure it explicitly via mapping.settings.page.

Event
Loading...
Mapping
Loading...
Result
Loading...

Order Completed (Segment Ecommerce Spec)

A single track('Order Completed', { products: [...] }) call using mapping.name for the PascalCase event name and mapping.data with a nested loop to build the products array inline.

Event
Loading...
Mapping
Loading...
Result
Loading...

The destination supports two complementary consent mechanisms:

Automatic context forwarding. When settings.consent is configured, every track, identify, group, and page call is stamped with context.consent.categoryPreferences. walkerOS consent keys are remapped to Segment category names:

Loading...

Deferred-load consent pattern. When config.consent is declared, AnalyticsBrowser.load() is held until the first walker consent command that grants all required keys. This is Segment's primary consent mechanism Analytics.js has no optOut() method, so the only way to enforce consent is to avoid loading the SDK in the first place.

Loading...

Scope Notes

  • alias() and screen() are intentionally deferred. alias() is a legacy identity-linking method; screen() is mobile-only.
  • Plugins, source middleware, and destination middleware cannot be serialized in JSON flow configs. Register them programmatically on the returned AnalyticsBrowser instance if needed.
💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)