track calls. Use this when you want try-on behavior in the same pipelines as your storefront (GA4, Mixpanel, Klaviyo, Snowflake, and so on).
This is separate from Hemsy Home in the dashboard, which shows aggregated KPIs (sessions, conversion, revenue, and so on). Segment receives individual events with properties; Hemsy Home computes rollups from Hemsy’s internal event store.
Where Segment forwarding applies
Segment forwarding works in both ways shoppers use Hemsy:
Both surfaces run the same try-on app and send events through the same browser API (
POST /api/events). Segment is not limited to embeds.
Segment forwarding does not apply to:
- The Hemsy dashboard (merchant admin UI).
- Server-only events (for example attributed orders written at checkout webhooks). Those feed Hemsy Home, not the Segment forwarder.
Setup
- In the Hemsy dashboard, open Integrations.
- Under Segment, enter your Segment Endpoint URL (for most workspaces:
https://api.segment.io). - Optionally enter your Write Key (required for standard Segment endpoints; leave blank only if your proxy authenticates requests another way).
- Save. The card shows Connected when an endpoint is configured.
POST requests to {endpoint}/v1/track with JSON bodies in Segment’s HTTP API shape.
Identity stitching (anonymousId)
To align Hemsy Segment events with your storefront identity graph, pass the same stable ID you use elsewhere (for example Segment’s anonymousId).
Hemsy sends this value as Segment’s anonymousId on every forwarded track. If you do not pass one, Hemsy uses its own browser visitor ID (hemsy_visitor_id in localStorage), which will not match your site unless you bridge IDs yourself.
There is no automatic cross-domain handoff from your storefront to {subdomain}.hemsy.ai. You must pass the ID explicitly using one of the methods below.
Embedded experience
Setdata-hemsy-anonymous-id on the embed script. The embed loader appends it to the iframe URL as anonymous_id:
anonymousId on window.HemsyEmbedConfig (see Hemsy Embeds).
Hosted experience
Add theanonymous_id query parameter to any link to your Hemsy subdomain:
anonymous_id, only Hemsy’s generated visitor ID is used.
Checkout metadata
The sameanonymous_id is attached to Shopify cart/checkout line-item metadata as attributes[anonymous_id] when the shopper completes checkout from either experience.
How forwarding works
- The shopper uses the embedded or hosted try-on experience.
- The browser records the event in Hemsy and POSTs to
/api/events. - If Segment is configured, Hemsy forwards a
trackcall with a human-readable name prefixed withHemsy.
- The event has a Segment mapping (see Forwarded events).
- Your store has a valid Segment endpoint saved in Integrations.
- The request passes Hemsy’s store context checks (host / origin / referer match your store slug or an allowed Hemsy host such as
hemsy.ai,{subdomain}.hemsy.ai, staging, or local dev).
Properties on every track call
In addition to event-specific fields below, each forwardedtrack includes:
Segment also receives
anonymousId and an ISO timestamp.
Forwarded events
Session and engagement
Try-on funnel
Look building
Guided flows
When a merchant flow is active (data-hemsy-flow on embed launchers, or flow query param on the hosted experience):
Browse, filter, and search
In free-browse mode (no active flow):Result screen
Hemsy Look Shared
This event fires on two different paths depending on whether share links are enabled for your store (sharing_enabled in Hemsy, or always on staging/preview hosts).
usedNativeShare vs shareUrl (type: share_link only)
These answer different questions:
Hemsy always tries the native share sheet first when
navigator.share is available and the share completes without cancellation. If that is not available or fails (other than the user dismissing the sheet), Hemsy copies shareUrl to the clipboard and sets usedNativeShare to false. Cancelling the native sheet does not fire Hemsy Look Shared.
share_image does not include usedNativeShare or shareUrl. That path uses the native share sheet with an image file when supported, otherwise a download — it is separate from the share-link pipeline in createShareHandler.
Sharing
Shared look opens are always counted in Hemsy Home (Top Shared Links). Confirm
Hemsy Shared Look Opened in your Segment debugger for your traffic;
contact Hemsy if you need guaranteed Segment delivery on every open.
Example track payload
Testing
- Save your Segment endpoint (and write key) in Integrations.
-
Embedded experience: Open Hemsy from your storefront with
data-hemsy-anonymous-idset to a test ID (for examplesegment-test-001). -
Hosted experience: Open
https://{subdomain}.hemsy.ai?anonymous_id=segment-test-001and run through upload → add items → try-on → checkout. -
In Segment Sources → Debugger, confirm
Hemsy *track events withanonymousId: segment-test-001.
- Confirm the integration shows Connected.
- Confirm you are on the correct subdomain or embed slug.
- Confirm the event is listed under Forwarded events, not Not forwarded.
Related docs
- Hemsy Embeds — embedded launch modes,
data-hemsy-anonymous-id, cart vs checkout - Hemsy dashboard Home — aggregated KPIs and funnels (no Segment required)