> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/flagship-deprecated/integrations/fe-and-r-heap-analytics/heap-analytics-integration-push.md).

# \[FE\&R] Send AB Tasty events to Heap

{% hint style="info" %}
Visitor ID requirement\
To make this integration work, you must use a valid user ID from Heap when calling the Decision API.

What you must do\
• Create the connector before sending hits\
• Ensure Heap has a known user\_id to associate events with the correct profile\
• Retrieve Heap’s existing user ID using:\
`heap.getUserId()`\
• It is strongly recommended to use Heap’s auto-generated ID\
• If you prefer to use your own custom ID, register it with:\
`heap.identify("your_custom_user_id")`\
• Call the Decision API with this same visitor ID; otherwise, the hit won’t be sent to the third party
{% endhint %}

Heap is a Product Analytics company that provides analytics infrastructure and helps its clients focus on discovering insights and taking action, rather than writing tracking code.

The Heap Analytics integration allows you to send the Feature Experimentation & Rollouts (FE\&R, formerly Flagship) campaign data to your Heap Analytics project.

## How to set up the integration <a href="#h_01j73nyfsf1gty81a2qkembw9s" id="h_01j73nyfsf1gty81a2qkembw9s"></a>

{% stepper %}
{% step %}

#### On Heap dashboard <a href="#h_01j73nyfsfqtmtq5e46jnvegf4" id="h_01j73nyfsfqtmtq5e46jnvegf4"></a>

1. Go to your Heap dashboard and click: **Account > Manage > Projects**
2. A right-side panel lists all linked environments (for example, *production* and *development*).
3. Copy the **Environment ID** of the [environment you want to connect to AB Tasty.](#user-content-fn-1)[^1]
   {% endstep %}

{% step %}

#### On AB Tasty

1. Open the **Integration Hub** under the **Feature Experimentation** tab.
2. Create a new **Heap push instance**.
3. Fill in the required details:
   * **Instance name** – a descriptive label for the integration.
   * **App ID** – paste the Heap environment ID you copied earlier.
4. Create the connector
   {% endstep %}

{% step %}
**Visitor ID Requirement**

1. The connector must be created before sending hits.
2. Heap requires a known `user_id` to associate events with the correct user profile.
3. Retrieve the existing user ID via:

   ```js
   heap.getUserId()
   ```
4. It’s strongly recommended to use Heap’s own generated ID. If you choose to create your own, register it using:

   ```js
   heap.identify("your_custom_user_id")
   ```

   This ensures Heap can match the user’s identity across events.
   {% endstep %}
   {% endstepper %}

{% hint style="warning" %}
**Decision API must be called with this visitorID, otherwise, the hit won’t be sent into the third party**
{% endhint %}

### **Troubleshooting** <a href="#h_01j73nyfsfqfsnr0k8sfqm50zw" id="h_01j73nyfsfqfsnr0k8sfqm50zw"></a>

You can verify the hit in real time in Heap by navigating to **Data → Live data feed**, where your `flagship` The event should appear alongside other user actions.

![](/files/3uPcUcAfUGN2EACORg05)

[^1]:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.abtasty.com/flagship-deprecated/integrations/fe-and-r-heap-analytics/heap-analytics-integration-push.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
