# Heap Destination

## About this integration

Heap captures user interactions, including clicks, taps, gestures, form submissions, and page views that you can leverage to gain a deeper understanding of your customers’ journeys through your website or product. This destination lets you use source data to identify your users, enrich their profiles with data, and send events that accurately represent their activities in your app. This data helps you gain a deeper understanding of your audience, so you can drive conversions, increase customer retention, and deliver better overall experiences to your users.

[Mode How we forward source data to the destination: through Customer.io's servers or directly from our JavaScript client.](/cdp/destinations/getting-started/#connection-mode)

[Web sources Indicates whether or not this integration supports our the JavaScript client.](/cdp/sources/getting-started/#types-of-sources)

[API sources Indicates whether or not this integration supports our server libraries (Go, NodeJS, Python), API, Mobile SDK, and other data sources.](/cdp/sources/getting-started/#types-of-sources)

[Supported calls The API methods this integration supports.](/cdp/sources/source-spec/source-events/)

[Integration name The name of this integration if you want to enable or disable it in the `integrations` object.](/cdp/sources/source-spec/common-fields/#the-integrations-object)

Standard

[track](/api/cdp/#operation/track) and [identify](/api/cdp/#operation/identify)

Heap Cloud (Actions)

Web

[track](/api/cdp/#operation/track) and [identify](/api/cdp/#operation/identify)

heap-web

## There are two versions of this integration[](#there-are-two-versions-of-this-integration)

You’ll see two entries for Heap in our [integration catalog](https://fly.customer.io/workspaces/last/journeys/integrations/all/directory), with one labeled *Web*. We typically recommend that you use the standard integration, the one *not* labeled “Web” when possible. The *web* version of this integration only works with our JavaScript client and does not pass data through Customer.io’s servers, which can make it hard to debug your integration, capture a history of events sent to the integration, and so on. Learn more about [Web integrations](/integrations/data-out/getting-started/#connection-modes).

## Getting started[](#getting-started)

1.  Go to **[Data & Integrations > Integrations](https://fly.customer.io/workspaces/last/journeys/integrations/all/directory)** and select the **Heap** entry in the *Directory* tab.
    
2.  (Optional) Select the data sources that you want to connect to your outbound integration. You can always connect data sources later. We’ll only show you data sources that work with your integration.
    
3.  Configure your integration.
    
    1.  **App Id**: The app\_id corresponding to one of your projects.
4.  Click **Enable Destination**.
    

### Actions[](#actions)

When you’re done setting things up, you can go to the *Actions* tab to see how we map incoming data to your integration.

You may need to add actions for this integration

While we often have default triggers for actions, we don't always add those actions as defaults. You may need to add actions to make sure that you're sending all the data that you want to send to your integration. See our [actions](/integrations/data-out/actions/) page for help setting up actions.

Action

Default Trigger

Description

Track Event

`type = “track”` or  
`type = “page”` or  
`type = “screen”`

Send an event to Heap.

Identify User

`type = “identify”`

Set the user ID for a particular device ID or update user properties.

## Getting started: web destination[](#getting-started-web-destination)

1.  Go to **[Data & Integrations > Integrations](https://fly.customer.io/workspaces/last/journeys/integrations/all/directory)** and select the **Heap** entry in the *Directory* tab.
    
2.  (Optional) Select the data sources that you want to connect to your outbound integration. You can always connect data sources later. We’ll only show you data sources that work with your integration.
    
3.  Configure your integration.
    
    1.  **App Id**: The app ID of the environment to which you want to send data. You can find this ID on the [Projects](https://heapanalytics.com/app/manage/projects) page.
        
    2.  **Disable Text Capture**: Setting to true will redact all target text on your website. For more information visit the heap [docs page](https://developers.heap.io/docs/web#global-data-redaction-via-disabling-text-capture).
        
    3.  **Secure Cookie**: This option is turned off by default to accommodate websites not served over HTTPS. If your application uses HTTPS, we recommend enabling secure cookies to prevent Heap cookies from being observed by unauthorized parties. For more information visit the heap [docs page](https://developers.heap.io/docs/web#securecookie).
        
    4.  **Tracking Server**: This is an optional setting. This is used to set up first-party data collection. For most cased this should not be set. For more information visit the heap [docs page](https://developers.heap.io/docs/set-up-first-party-data-collection-in-heap).
        
    5.  **Hostname**: This is an optional setting used to set the host that loads heap-js. This setting is used when heapJS is self-hosted. In most cased this should be left unset. The hostname should not contain https or app id it will be populated like so: https://${hostname}/js/heap-${appId}.js. For more information visit the heap [docs page](https://developers.heap.io/docs/self-hosting-heapjs).
        
4.  Click **Enable Destination**.
    

### Web destination actions[](#web-destination-actions)

When you’re done setting things up, you can go to the *Actions* tab to see how we map incoming data to your integration.

You may need to add actions for this integration

While we often have default triggers for actions, we don't always add those actions as defaults. You may need to add actions to make sure that you're sending all the data that you want to send to your integration. See our [actions](/integrations/data-out/actions/) page for help setting up actions.

Action

Default Trigger

Description

Track Event

`type = “track”`

Track events

Identify User

`type = “identify”`

Sets user identity

## Troubleshooting[](#troubleshooting)

### Anonymous traffic from server-side sources doesn’t appear in Heap[](#anonymous-traffic-from-server-side-sources-doesnt-appear-in-heap)

Heap’s API rejects server-side events that don’t include a `user_id`. You’ll need to pass a `user_id` in event calls from server-side sources — even if you use the `anonymous_id` as the `user_id` — when you send server-side events to Heap.

### Heap does not supported nested objects/arrays[](#nested-objects-arrays)

Heap does not accept nested properties so we automatically flatten the incoming object and stringify nested values from your source calls before we send data to Heap.

For example, if you sent this event:

```javascript
cioanalytics.track('Signed Up', {
  foo: {
    bar: {
      cheese: 'american',
      prop: [1, 2, 3],
      products: [{"A": "Jello"}, {"B": "Peanut"}]
    }
  }
});
```

We’d transform the properties for Heap like this:

```javascript
foo.bar.cheese: 'american'
foo.bar.prop: '[1,2,3]'
foo.bar.products: "[{'A': 'Jello'},{'B': 'Peanut'}]"
```