> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Heap

> Sync your most recently captured event data to Heap to both measure and dramatically improve your digital experience

## Setup

Upon selecting Heap as your destination you will be prompted to
input your Heap Environment ID, which correspond to the specific project environment
you wish to sync your data to.

You can locate the appropriate Environment ID within your Heap account by navigating to
*Account > Manage > Projects* and clicking on your desired project:

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-heap-setup.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=f8ce11b9a984ce10e943b625eb4e0d68)

## Heap sync types

Hightouch supports syncing the following Heap sync types:

* `Events`
* `Objects`:
  * `User Properties`
  * `Account Properties`

## Syncing objects

### Object sync modes

* **Upsert**: pushes new objects to Heap *and* updates fields that change in your warehouse.

### Record matching

Records can be matched from your source to your Userflow workspace by the `identity` (typically a unique user property)
or `account_id`, depending on the object you are syncing.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-heap-object-record-matching.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=68bdae365e300f5b7f998bbe987d956f)

### A note on syncing account properties

To sync account properties you must first have users synced into your Heap workspace.
The reason for this is that to sync account properties you must first configure Account IDs.
This may be done by navigating to *Account > Manage > Features* and reading the following:

> *"To analyze accounts in Heap, you need to specify a user property that can be used to group users into accounts (for example, Account ID).*"

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-heap-account-id-config.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=179dd8df10926fe61ba0b78f4ef06d19)

## Syncing events

When syncing events, Hightouch treats any records added to [your source](https://docs.hightouch.com/getting-started/concepts.md) as new events and sends them to Heap when your sync runs.

> [!WARNING]
>
> To ensure syncs send each event, your event model must use a truly unique [primary key](https://docs.hightouch.com/getting-started/concepts.md#unique-primary-key-requirement). See the [events syncs](https://docs.hightouch.com/syncs/types-and-modes.md#event-syncs) documentation for more information.

### Event sync modes

* **Insert**: *only* pushes new events to Heap.

### Event name

To specify the name of the event you wish to sync to Heap you have the option of either
inputting the name of a particular event or using a column from your model.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-heap-event-name.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=98c921e07f41f8d95b6a17b93a5cfbec)

### Timestamp

You may also specify the timestamp of the event in your source. However, be aware that this value
may be overridden by its respective mapping and is completely optional. If you choose not to explicitly specify
a timestamp then Heap will use the time the event arrives to the server.

### Identity

The identity of an event is a required field and is typically a unique user property. If the specified identity
doesn't exist, a new user will be created with that identity in Heap.

## Field mapping (events and objects)

You may also sync columns from your source to Heap as event, user, or account `properties`.
Any property previously created will be updated and any new properties will be created.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-heap-field-mapping.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=bd20b4a8387e5c843eb1f3089c127819)

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).
