# Heap

## Enable the integration

* Navigate to [our integrations page](https://i.usejimo.com/settings/integrations)
* Click the Connect button of the Heap integration

<div align="left"><figure><img src="/files/PsbXszLhyd7llSzoxdsf" alt="" width="341"><figcaption><p>Heap integration</p></figcaption></figure></div>

## Jimo → Heap

Send Jimo events to Heap. This setup would allow you to capture a comprehensive view of user engagement across your platform. By funneling events from Jimo into Heap, you can leverage Heap's powerful analytics tools to track, visualize, and analyze user interactions, helping you to better understand user behavior and refine user experience strategies based on actionable insights. This connection ensures that all relevant user activity within Jimo is seamlessly integrated into Mixpanel's analytical environment.

<figure><img src="/files/4o8lEFDmiaDoDTpYArOh" alt=""><figcaption><p>Visualize and create analytics dashboard based on Jimo events in Heap</p></figcaption></figure>

You can find a list of possible events and their properties

{% content-ref url="/pages/NazFJDVUwpEjqUbYGwxT" %}
[Events for Analytics Integrations](/docs/integrations/events-for-analytics-integrations.md)
{% endcontent-ref %}

#### How to enable?

* Enable the option *Jimo → Heap* in the integration settings

<figure><img src="/files/3RBoqwK1q20bGQtWTY05" alt=""><figcaption><p>Enable Jimo → Heap</p></figcaption></figure>

{% hint style="success" %}
You are all setup 🎉
{% endhint %}

## Heap → Jimo

Send Heap events to Jimo. This setup enables the utilization of Heap's events within Jimo targeting audiences, specifically for the "Who" section (targeting specific user segments) and creation of Segment of users. This ensures that Jimo's engagements are deeply personalized, enhancing user interaction based on precise analytical insights from Heap.

<figure><img src="/files/DzU1Mtl8aCxgzDb9ubOS" alt=""><figcaption><p>Create audience based on Heap events</p></figcaption></figure>

#### How to enable?

* Enable the option *Heap → Jimo* in the integration settings

<figure><img src="/files/Cfnsw9btzqGo0aSAEYs1" alt=""><figcaption><p>Enable Heap → Jimo</p></figcaption></figure>

* Add the following code in your application

```javascript
/**
  Numerous organizations employing Heap for event tracking generally maintain
  a universally accessible function for capturing these events.
  
  The easiest method to ensure all these events are also recorded in Jimo
  is by integrating a heap:track call from the Jimo SDK into this existing function.
  This technique guarantees the simultaneous capture of events across both platforms.
*/

// Create a universal function
const trackEvent = (name, properties) => {
  window.heap.track(name, properties); // You should have this already
  
  window.jimo.push(["do", "heap:track", [name, properties]]);
};

// Let's use it
trackEvent("purchase", { amount: 199 })
```

{% hint style="success" %}
You are all setup 🎉
{% endhint %}

## Trigger an experience from a Heap event

To display an experience following a Heap event in your application, go to the **Settings** page of the experience, set the trigger to '**On event**,' and select the specific Heap event to use.

<figure><img src="https://i.gyazo.com/fb7a3ba1a4c94ae5fd86700cdf66af6b.png" alt=""><figcaption><p>Set the experience trigger to <strong>On event</strong></p></figcaption></figure>

<figure><img src="/files/sYqQBYLWJXRcWX7R0r9G" alt=""><figcaption><p>Select the Heap event that should trigger the experience</p></figcaption></figure>

## Synchronise Heap segments

This integration also allows you to import your Heap segments in Jimo and keep them in sync. Whenever a user is added or removed from the Heap segment, it will be sync with Jimo.

{% hint style="info" %}
There can be a delay before changes are being reflected in Jimo
{% endhint %}

1. Connect your Heap account<br>

   <figure><img src="/files/JirFc6ExQZ2SFYhjtNE8" alt=""><figcaption></figcaption></figure>
2. Open your Heap segment details, find the Integrations section and enable the Jimo integration.<br>

   <figure><img src="/files/7YIWSvwHvnBktWdNzoLG" alt=""><figcaption><p>Enable Jimo integration for a Heap segment sync</p></figcaption></figure>
3. You should find your Heap segment in the [list of Jimo segments](https://i.usejimo.com/segments)\
   &#x20;

   <figure><img src="/files/2o13boM2Gygz03zr7RTW" alt=""><figcaption><p>Heap segment being synced in Jimo</p></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://help.usejimo.com/docs/integrations/heap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
