--- title: "Heap integration: stream Userflow events and sync segments" slug: "heap" description: "Integrate Userflow with Heap to analyze user interactions, sync segments, and enhance your product analytics for better insights and targeted content." updated: 2026-10-28T19:40:34Z published: 2026-10-28T19:40:34Z canonical: "help.userflow.com/heap" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.userflow.com/llms.txt > Use this file to discover all available pages before exploring further. # Heap integration: stream Userflow events and sync segments The Heap integration connects one Userflow environment to one Heap environment. It does two things: it streams Userflow-generated events into Heap, and it syncs segments you define in Heap into Userflow so you can target content with them. [Userflow-generated events](https://help.userflow.com/docs/userflow-generated-events), such as **Flow Started** and **Checklist Task Completed**, are streamed into the Heap environment you choose. Heap segments show up as segments on the **Users** page in Userflow. ## Do I need a separate Heap integration for Staging and Production? Yes. Each Heap integration connects one Userflow environment to one Heap environment. Use a separate Heap environment for each of your app's environments (Production, Staging and so on), the same way you use separate [Userflow environments](https://help.userflow.com/docs/environments-and-versions). This keeps Staging data out of Production. If you have both Staging and Production, connect Heap once in each Userflow environment: switch environments in the top-right corner of Userflow, then follow [Connect Heap to Userflow](/docs/heap#connect-heap-to-userflow) again. **We strongly recommend** connecting Staging first and checking that it works before you connect Production. ## Use the same user ID in Heap and Userflow The Heap integration matches users by user ID. Identify each user with the same ID in Heap and in Userflow, or events and segments won't line up. ## Connect Heap to Userflow 1. Sign in to Userflow. 2. Check that the correct Userflow environment is selected in the top-right corner. 3. Go to **Settings → Integrations**. 4. Click **Add integration**. 5. Click **Heap**. 6. Click **Add Heap**. 7. Click **Connect with Heap**. 8. In the popup window, choose your Heap environment in the top-right corner. 9. Click **Allow**. Userflow and Heap are now connected, but no data moves yet. To start, set up segment sync, event streaming, or both. ## Sync Heap segments to Userflow Heap segment sync keeps a Heap segment up to date as a segment in Userflow, so you can target Userflow content at it. 1. Sign in to Heap. 2. Go to **Definitions → Segments**. 3. Choose your segment. 4. In the right-side panel under **Integrations**, switch **Userflow** to ON. 5. The first time you turn on segment sync, Heap asks how to map users. We recommend **Identity**. 6. Click **Enable Recurring Sync**. **Sync now** runs a one-time sync instead, which is rarely useful with Userflow because the segment won't stay current. 7. Sign in to Userflow and go to **Users**. 8. Within a few moments, the segment appears in the segment list on the left with a Heap icon. Reload the page if you don't see it. ## Stream Userflow events to Heap Event streaming sends Userflow-generated events to Heap as they happen. 1. Sign in to Heap. 2. Check that the correct Heap environment is selected in the top-left corner. 3. Copy your Heap App ID from the browser's address bar. It's the `<id>` part of `https://heapanalytics.com/app/env/<id>/...`. 4. Sign in to Userflow and go to **Settings → Integrations → Heap**. 5. Paste the Heap App ID into the **Heap App ID** field. 6. Click **Save**. 7. Switch **Stream events from Userflow to Heap** to ON. Streaming starts immediately. 8. In Heap, go to **Live** and check that Userflow events are coming in. To trigger one, open the Resource Center or start a flow. ## How do I disconnect Heap? 1. In Userflow, go to **Settings → Integrations** and find **Heap**. 2. Click the three-dot button in the top right. 3. Click **Disconnect**. Event streaming and Heap segment sync stop immediately. ## Related articles - [Userflow-generated events](https://help.userflow.com/docs/userflow-generated-events): the full list of events Userflow streams to Heap - [Users and Segments](https://help.userflow.com/docs/users-and-segments): where synced Heap segments appear and how to use them for targeting - [Setting up environments and versions](https://help.userflow.com/docs/environments-and-versions) - [Integrations](https://help.userflow.com/docs/integration-old): every integration Userflow supports A persistent list of tasks or items that users can follow to ensure completion of techniques, often used for onboarding, setup, or feature adoption.