# Heap

After sending Freshpaint data to Heap, teams can harness the power of product analytics to drive better, data-driven business outcomes.

## Destination Info

* Accepts [Track](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#track) and [Identify](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify) calls
* Supports [HIPAA mode](https://documentation.freshpaint.io/hipaa-mode)
* Connection Modes:

<table><thead><tr><th align="right"> </th><th data-type="checkbox">Client-side</th><th data-type="checkbox">Server-side</th></tr></thead><tbody><tr><td align="right">Web</td><td>true</td><td>true</td></tr><tr><td align="right">Mobile</td><td>false</td><td>true</td></tr><tr><td align="right">Server</td><td>false</td><td>true</td></tr></tbody></table>

## Getting Started

To set up the Heap integration, follow these steps:

1. Go to the [Heap configuration page](https://app.freshpaint.io/destinations/apps/heap) in Freshpaint and click *Configure* for `App ID`.
2. In Heap, go to your Account Projects page and copy/paste the ID for the Environment you want to use into the App ID setting in Freshpaint:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FhxyTwDmwh89DamSV0Hyx%2Fimage.png?alt=media&#x26;token=886f8c3c-f694-4607-a3d8-7148daa6fc0e" alt=""><figcaption></figcaption></figure>

## Identify

It is important to first [Identify ](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify)your users so Heap knows who they are and associates events to their [User Identity](https://developers.heap.io/docs/using-identify) in Heap.

When you call [freshpaint.identify](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify), Freshpaint will create or update a Heap User Identity by calling Heap's [identify API](https://developers.heap.io/docs/using-identify). Any user properties you pass in will be forwarded directly to Heap.

Here is an example of an identify call:

```javascript
freshpaint.identify("ada.lovelace@example.com", {
    /* user properties */
    "email": "ada.lovelace@example.com",
    "name": "Ada Lovelace",
    "role": "mathematician",
    "specialty": "computer languages"
});
```

This creates the following User in Heap:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FdufiZd7Kw219nZQYQpyI%2Fimage.png?alt=media&#x26;token=4da1b64e-0479-479d-aaac-7c9147991369" alt=""><figcaption></figcaption></figure>

## Events

### Seeing Freshpaint Events in Heap

Once the Heap integration [is enabled](https://app.gitbook.com/o/-MA7b_ezO9UcpNU5sTg_/s/-MA7aDqsXMFbUsWVqonF/~/changes/1124/readme/setting-up-your-destinations/enabling-and-disabling-a-destination), you can now set it as an event destination:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2Fgit-blob-3300092fb4eac5624cca3f192db7f600c41dc7d2%2Fimage%20(40).png?alt=media" alt=""><figcaption></figcaption></figure>

Events sent from Freshpaint will show up as Heap events:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FKeJscjmp77YpDoTQpEhW%2Fimage.png?alt=media&#x26;token=b26930a8-e9a0-4f70-b2e1-641e47f309e3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You should make sure [Identify](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify) occurs before any Tracked events, so they are associated with the Identified user. The Heap API does not support merging anonymous users with Identified users.
{% endhint %}

### Event Transformations

Set up transformations to modify your data before it's sent to your destination:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FK6WG04hQZD1IMAfQFSjA%2Fimage.png?alt=media&#x26;token=ca652fec-4467-4521-9c88-cc347cf20479" alt=""><figcaption></figcaption></figure>
