# 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FkgO8PRgNPihXNAcV3E3D%2F43299687998a9b2b8052c3369f14455c.png?alt=media&#x26;token=ae24c05a-44cd-4999-9ee7-2e188d1da7ab" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FQVem19xmLzBpan8w1Itw%2F2264bd84761f1166d3457cfacb4a5621.jpg?alt=media&#x26;token=07d3dc87-c75d-4035-b09c-a5252dba23dc" 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="events-for-analytics-integrations" %}
[events-for-analytics-integrations](https://help.usejimo.com/docs/integrations/events-for-analytics-integrations)
{% endcontent-ref %}

#### How to enable?

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

<figure><img src="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FIs3XOMbp7raQqhwdCfvF%2F90e3223f4a0f1249d64430df00d0aefb.jpg?alt=media&#x26;token=edb28e9d-0d14-4bab-b512-9c42d00e5d34" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FLLmFPXE7gIsCq2GvfJkN%2F08c45dd994545eda397e51a31b37775e.jpg?alt=media&#x26;token=80aebb32-b53a-45ee-acc2-6f81a0fc426b" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FU6x7sEJZSd4sR9Pe7Haq%2F21430f4ce6af7aa92b17b9c46ac2e30f.jpg?alt=media&#x26;token=7016388b-c299-4ee7-ba1a-af1aa9d15a50" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FUI2bVb63ohMw3jirDQoT%2F274525eff1dc52ad35979908346dd0ac.jpg?alt=media&#x26;token=c70151ad-0d1e-4932-80d9-fdfd5ccd5dfc" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FawrK2NhniR2l2jbJDvey%2Fe394a541598d121bc26c7854cafc00dc.jpg?alt=media&#x26;token=1916e11e-1e93-4118-89a4-c6e77ebdd895" alt=""><figcaption></figcaption></figure>
2. Open your Heap segment details, find the Integrations section and enable the Jimo integration.<br>

   <figure><img src="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2F6WWBghS9wDSaQhzdkOtu%2F18d163fcbafcc8e2e68a0503b23dd5fc.jpg?alt=media&#x26;token=376b98f1-4989-4262-af58-2977278dd8a0" 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="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2Fes69EhSgzBBmWgZ6EAfW%2F69a5587fe197ec3ccd208a56af6e85dc.png?alt=media&#x26;token=72f2272d-f37c-4dbe-9d7d-5306f5ca4bd7" alt=""><figcaption><p>Heap segment being synced in Jimo</p></figcaption></figure>
