# Send Feature Experimentation Event to Heap

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

{% 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.

**To 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 %}

### 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

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fq513F0Pk4DmvHxoctBPh%2FCapture%20d%E2%80%99e%CC%81cran%202026-03-09%20a%CC%80%2017.51.56.png?alt=media&#x26;token=8a359d55-55ce-4293-bb14-b19e2c47aca0" alt=""><figcaption></figcaption></figure>

1. Open the **Integration Hub** under the **Feature Experimentation** **Tab**.
2. Select **Heap > Create**
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.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2F3F7NRQeR3lawT8y5oiCm%2F225b5669dd95178d50b2c72677e93c6c.png?alt=media\&token=40efc50a-8f9f-4677-b583-9251c9fda37d)

[^1]:
