The Segment integration lets Userflow work as both a Segment source and a Segment destination. As a source, Userflow streams its events into Segment so they can be forwarded to your other tools. As a destination, Segment sends user attributes and events from your other sources into Userflow.
Setting up the Segment integration has three parts. Do them in this order:
Why does the Segment integration use an HTTP API source and webhooks?
Segment stopped accepting new web plugin integrations in late 2019, so Userflow can’t appear as a regular Segment integration. Instead, the Segment integration uses Segment’s standard HTTP API source and Webhooks destination. This also means you install Userflow.js in your front end yourself; Segment doesn’t load it for you.
We recommend a dedicated HTTP API source for Userflow. Don’t reuse its Segment Write Key for anything else.
Do I need a separate Segment integration for Staging and Production?
Yes. Each Segment integration connects one Userflow environment to one Segment source and destination. Use separate Segment sources and destinations for each of your Userflow environments, such as Production and Staging, so Staging data doesn’t mix with Production data.
If you have both, complete all three parts once for each. We strongly recommend connecting Staging first and checking that it works before you connect Production.
Use the same user ID in Segment and Userflow
The Segment integration matches users by user ID. Identify each user with the same ID in Segment and in Userflow, or the data won’t line up.
Set up the Segment integration in Userflow
Sign in to Userflow and switch to the environment you want to connect to Segment.
.png)
Go to Settings → Integrations and click Add integration.
.png)
Find and click Segment in the list.

Click Add Segment.

If you don’t see Add Segment, the integration may not be included in your plan. Check your billing settings.
When this is done, continue with Add Userflow as a source in Segment.
Add Userflow as a source in Segment
Adding Userflow as a Segment source streams Userflow-generated events, such as Flow Started and Checklist Task Completed, into Segment. Set up the Segment integration in Userflow first.
Sign in to Segment and click Add Source.

Search for and click HTTP API.

Click Add Source.

Give the source a name, such as “Userflow”, and click Add Source.

Copy the Write Key.

In Userflow, go to Settings → Integrations → Segment. Paste the Write Key into the Segment Write Key field and click Save.

Click the Stream events from Userflow to Segment switch and confirm in the dialog.
.png)
Streaming starts immediately.
.png)
In Segment, open the Debugger tab and check that Userflow events are coming in. They usually appear within a few seconds.

When this is done, continue with Add Userflow as a destination in Segment.
How do I stop streaming Userflow events to Segment?
In Userflow, go to Settings → Integrations and open Segment.
Check the Stream events from Userflow to Segment switch. Gray means streaming is already off. Green means it’s on.
Click the switch and confirm in the dialog.
Event streaming to Segment stops immediately.
Add Userflow as a destination in Segment
Adding Userflow as a Segment destination sends user attributes and events from your other Segment sources into Userflow. Set up the Segment integration in Userflow first.
Sign in to Userflow, go to Settings → Integrations → Segment, and copy the Webhook URL.

Sign in to Segment and click Add Destination.

Search for and click Webhooks.

Click Configure Webhooks.

Select the sources you want to send to Userflow. Usually this is a separate source for your back end.

Click Confirm Source.

Click Webhooks.

Paste the Webhook URL from Userflow into the Webhook URL field and click Save.

Click the toggle to turn on the destination.

In Userflow, go to Users and check that users and events from Segment are coming in.
Send company events from Segment to Userflow
This only applies if you use companies in Userflow.
Segment doesn’t link events to companies directly. A common workaround is an event property that names the company, such as company_id or workspace_id. Userflow can read that property and attach each event to the right company.
Sign in to Userflow and go to Settings → Integrations → Segment.
Enter the name of your company event property and click Save.

Related articles
Rudderstack integration: uses this same setup with a custom API URL