> For the complete documentation index, see [llms.txt](https://help.usejimo.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.usejimo.com/docs/integrations/heap.md).

# Heap

Send Jimo experience events to Heap, bring Heap events into Jimo for targeting and triggers, and keep Heap segments in sync.

The Heap integration works in both directions. Jimo sends experience events to Heap for your dashboards, and Heap events come into Jimo to target and trigger experiences.

## What it does

| Direction             | What it sends                                                      | What you do with it                                      |
| --------------------- | ------------------------------------------------------------------ | -------------------------------------------------------- |
| Jimo to Heap          | Experience events: tour, survey, checklist, banner and hint events | Dashboards and funnels in Heap                           |
| Heap to Jimo          | The Heap events your app tracks                                    | Audiences in Who, segments, and the **On event** trigger |
| Heap segments to Jimo | Membership of the Heap segments you enable                         | Jimo segments that stay in sync                          |

Each direction is a separate option in the integration settings. Turn on only the ones you need.

<figure><img src="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FCKJ37yqPuXYZ6D6jxKZe%2FF2-52d-analytics-flow-heap.png?alt=media&amp;token=8395c0fa-28d1-4c5b-9175-2d6775ba6f73" alt="Jimo sends experience events to Heap when Jimo to Heap is on; Heap events reach Jimo through one jimo.push line when Heap to Jimo is on, for Who, segments and the On event trigger; Heap segments stay in sync with Jimo segments"><figcaption></figcaption></figure>

## Before you start

* A Heap account.
* For Heap to Jimo, a developer adds one line to the function your app already uses to track Heap events.
* A Jimo role with access to the Integrations settings. See [Integration setup](https://help.usejimo.com/docs/integrations/integration-setup.md).

## Connect

In [Settings > Integrations](https://i.usejimo.com/settings/integrations), hover the Heap card and click **Enable**.

<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&amp;token=ae24c05a-44cd-4999-9ee7-2e188d1da7ab" alt="Heap card in Settings > Integrations"><figcaption></figcaption></figure>

### Send Jimo events to Heap

Turn on 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&amp;token=edb28e9d-0d14-4bab-b512-9c42d00e5d34" alt="Jimo to Heap option turned on"><figcaption></figcaption></figure>

The events and their properties are listed in [Events for analytics integrations](https://help.usejimo.com/docs/integrations/events-for-analytics-integrations.md).

<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&amp;token=07d3dc87-c75d-4035-b09c-a5252dba23dc" alt="A Heap dashboard built on Jimo events"><figcaption></figcaption></figure>

### Send Heap events to Jimo

{% stepper %}
{% step %}

### Turn on the option

Turn on **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&amp;token=7016388b-c299-4ee7-ba1a-af1aa9d15a50" alt="Heap to Jimo option turned on"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the Jimo call to your tracking function

Most apps track Heap events through one shared function. Add the Jimo call next to the Heap call, so every event reaches both tools.

```javascript
// Your shared tracking function
const trackEvent = (name, properties) => {
  window.heap.track(name, properties); // You should have this already

  window.jimo.push(["do", "heap:track", [name, properties]]);
};

// Example
trackEvent("purchase", { amount: 199 });
```

{% endstep %}
{% endstepper %}

### Sync Heap segments

Import your Heap segments into Jimo and keep them in sync: when a user joins or leaves the Heap segment, the Jimo segment follows.

{% stepper %}
{% step %}

### Connect your Heap account

<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&amp;token=1916e11e-1e93-4118-89a4-c6e77ebdd895" alt="Connect the Heap account"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Enable Jimo on the Heap segment

In Heap, open the segment details, find the **Integrations** section and enable Jimo.

<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&amp;token=376b98f1-4989-4262-af58-2977278dd8a0" alt="Jimo enabled in the integrations of a Heap segment"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Find it in Jimo

The Heap segment appears in your [list of Jimo segments](https://i.usejimo.com/segments).

<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&amp;token=72f2272d-f37c-4dbe-9d7d-5306f5ca4bd7" alt="Heap segment synced in Jimo"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Changes in a Heap segment can take some time to show in Jimo.
{% endhint %}

## What flows

| Direction             | What arrives                                                                                                                                                                                                | Where you see it                                                                                                                                       |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Jimo to Heap          | The events listed in [Events for analytics integrations](https://help.usejimo.com/docs/integrations/events-for-analytics-integrations.md), named **Jimo Tour Started**, **Jimo Survey Completed** and so on | In Heap, with your other events                                                                                                                        |
| Heap to Jimo          | The events your tracking function passes to `jimo.push`, from the day you add the call                                                                                                                      | Listed in [Success Tracker > Events](https://help.usejimo.com/docs/analyze/success-tracker/events.md), and available in Who, segments and **On event** |
| Heap segments to Jimo | Membership of the Heap segments where Jimo is enabled                                                                                                                                                       | Your [list of Jimo segments](https://i.usejimo.com/segments)                                                                                           |

## Use Heap data in Jimo

* **Target:** build an audience on Heap events in [Who](https://help.usejimo.com/docs/publish/target-right-people-who.md), or save it as a [segment](https://help.usejimo.com/docs/analyze/users-and-segments/audience/segments/create-a-segment.md).

<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&amp;token=80aebb32-b53a-45ee-acc2-6f81a0fc426b" alt="Audience built on Heap events"><figcaption></figcaption></figure>

* **Trigger:** show an experience right after a Heap event. In the experience's settings, set **Show on** to **On event** and select the Heap event. See [Show on](https://help.usejimo.com/docs/publish/trigger-on-the-right-spot-show-on.md#on-event).

## Verify

* **Jimo to Heap:** complete a tour or a survey yourself, then look for the matching **Jimo Tour Completed** or **Jimo Survey Completed** event in Heap.
* **Heap to Jimo:** fire a tracked event in your app, then check that it is listed in [Success Tracker > Events](https://help.usejimo.com/docs/analyze/success-tracker/events.md). The list shows each event once, with its **Source** and when it was **Last received at**, not a history over time: to follow an event over time, create a feature usage [tracker](https://help.usejimo.com/docs/analyze/success-tracker/trackers.md).

<figure><img src="https://2794860263-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzAcDWQbK1gKbpra7bkb%2Fuploads%2FHQ6OzATEzsI5Ysw2PSZd%2FF2-03-incoming-event.png?alt=media&amp;token=cb7ffdec-4caf-4022-aa84-a47bec0e0c71" alt="Success Tracker > Events, with the columns Name, Source, Created at and Last received at. The row of an event received from Segment is outlined, and A marks its Source."><figcaption></figcaption></figure>

## Limits

#### Jimo to Heap only sends experience events

The events listed in [Events for analytics integrations](https://help.usejimo.com/docs/integrations/events-for-analytics-integrations.md). Changelog posts and resource center interactions are not in that list.

#### Heap to Jimo starts at setup

Only events sent after you add the Jimo call reach Jimo. Past Heap events are not imported.

## Related

* [Events for analytics integrations](https://help.usejimo.com/docs/integrations/events-for-analytics-integrations.md)
* [Integrations](https://help.usejimo.com/docs/integrations/integrations-list.md)
* [Attributes and events](https://help.usejimo.com/docs/getting-started/install-jimo/attributes-and-events.md)
