Connect Segment¶
Segment is a customer data platform (CDP): instead of Squoosh reading from a reporting API, your Segment workspace pushes events to Squoosh through a destination you configure. This page covers what that connection does today and how to set it up.
Beta — surface stage
Segment is an early, surface-stage connector. Squoosh verifies and accepts the events your Segment destination sends, but it does not yet turn them into a calibration signal for synthetic shoppers — that aggregation step is staged, upcoming work. Connecting Segment today gets the plumbing in place; it does not change how your shoppers are calibrated yet. For a calibration source that works today, see Google Analytics or Connect Shopify.
What the connection does¶
- In the sidebar, click Integrations.
- In the Segment row, click Connect.
- Squoosh generates a unique ingest URL and a shared secret, and shows both to you once.
- Copy both immediately. The secret is not stored in a way Squoosh can show you again — if you lose it, disconnect and reconnect to generate a new one.
The row shows Endpoint ready once the connection is created, and Receiving events after Segment successfully sends its first event.
Add the destination in Segment¶
In your Segment workspace, add a Webhooks (Actions) destination on the source you want to send from. (Segment's older, classic Webhooks destination is in maintenance mode — use Webhooks (Actions) for any new setup.)
- In Segment, go to your source's Destinations and add a new Webhooks (Actions) destination.
- On the destination's Send action, set:
- URL — the ingest URL Squoosh gave you (
https://<your-squoosh-domain>/api/integrations/segment/ingest?connection=<your connection id>). - Method —
POST(required). - Headers — add
x-squoosh-segment-secret: <the shared secret>. - Enable the destination and send a test event from Segment.
A successful test event gets a 202 Accepted response. A 401 response means the secret or ingest URL is wrong — recheck what you pasted, or reconnect in Squoosh to mint a fresh secret.
Alternative: Segment's own Shared Secret signing¶
Instead of the x-squoosh-segment-secret header, you can use Segment's own signing mechanism: in the destination's Settings → Advanced Settings, set Shared Secret to the same shared secret Squoosh gave you. Segment then signs every request body with HMAC-SHA1 and sends the digest in an X-Signature header, which Squoosh verifies automatically — no Headers mapping needed. Either mechanism works; use whichever is easier to set up in your workspace.
If you have batching enabled on this destination, Segment signs only the first event of the batch rather than the whole request body — Squoosh's signature check verifies against the full body it received, so a batched, signed request will fail here. Use the x-squoosh-segment-secret header instead if you need batching on.
Segment's Webhooks (Actions) destination has no Basic-auth option, so don't look for one — the two mechanisms above are the only ones this endpoint accepts.
What happens in the surface stage¶
Every event Segment sends is checked against your shared secret and, if valid, acknowledged. Squoosh does not store or process the event payload at this stage — there's no event history to browse and no effect on your synthetic shopper pool yet. This is intentional: Squoosh does not fabricate a calibration signal from a connection it can't yet ground in real aggregated data. When Segment aggregation ships, this page will describe what it calibrates and how.
Change or remove the connection¶
In the Segment row:
- Click Disconnect to remove the connection. Squoosh stops accepting events at the ingest URL (any further requests get
401), and the shared secret is invalidated. - Reconnecting generates a new ingest URL and a new shared secret — update your Segment destination with both.
Troubleshooting¶
| Problem | What to do |
|---|---|
Ingest URL returns 401 |
The shared secret doesn't match, the connection was disconnected, or the ingest URL's connection id is wrong. Reconnect in Squoosh to get a fresh URL and secret, then update the Segment destination. |
Ingest URL returns 404 |
Segment inbound isn't enabled for your workspace yet. |
Ingest URL returns 413 |
A single event payload was over 1 MB. Segment's own payloads are far smaller than this in normal use — check the destination isn't batching an unusually large request. |
| Nothing changes in my synthetic shoppers | Expected for now — see the surface-stage note above. Segment doesn't calibrate shoppers yet. |
Related¶
- Google Analytics and Shopify — calibration sources that work today.
- Synthetic shoppers — how a calibrated pool behaves once a source is grounded.