Heap Destination
Destination Info
- Accepts Identify, and Track calls
- Refer to it as Heap in the Integrations object
Components
- Browser
- Server
Heap automatically captures every user interaction with no extra code. This includes clicks, taps, gestures, form submissions, page views, and more. The Heap Destination is open-source. You can browse the code on GitHub.
Getting Started
- From the Segment web app, click Catalog.
- Search for “Heap” in the Catalog, select it, and choose which of your sources to connect the destination to.
- In the destination settings, enter your Heap “App ID” into the connection settings.
- Remove Heap’s snippet from your page if you’re using Segment’s client-side Analytics.js library to load Heap. With the Analytics.js library, Segment asynchronously loads Heap’s JavaScript library onto your page. All native functionality of Heap, including auto-capturing of all events, is available to you.
Identify
If you’re not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:
analytics.identify('userId123');
When you call identify
, Segment calls Heap’s identify method with the userId
and traits
you provide.
If one of your traits
is of the date property type, we will convert it into an ISO string.
Track
If you’re not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:
analytics.track('Clicked Button');
When you call track
from analytics.js
, Segment calls Heap’s track function with the same parameters. Calling track
from one of Segment’s mobile SDKs or server-side sources records a Heap Custom Event with the same event name and properties.
If one of your properties
is of the date property type, we will convert it into an ISO string.
Troubleshooting
Anonymous traffic not showing up from server-side source
Ensure that you are specifying a user_id
in your event calls. The Heap API will reject any server-side events without a user_id
.
Nested Objects and Arrays
Heap does not accept nested properties, so we will flatten and stringify them before sending to Heap. For example:
analytics.track('Signed Up', {
foo: {
bar: {
cheese: 'american',
prop: [1, 2, 3],
products: [{"A": "Jello"}, {"B": "Peanut"}]
}
}
});
The properties would be sent as:
foo.bar.cheese: 'american'
foo.bar.prop: '[1,2,3]'
foo.bar.products: "[{'A': 'Jello'},{'B': 'Peanut'}]"
Engage
You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.
For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true
. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Engage sets that value to false
.
When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.
Real-time to batch destination sync frequency
Real-time audience syncs to Heap may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.
Settings
Segment lets you change these destination settings from the Segment app without having to touch any code.
Setting | Description |
---|---|
App ID (required) |
string . You can find the snippet containing your app ID in Heap’s QuickStart docs. It’s inside the heap.load('YOUR_APP_ID') function call. |
This page was last modified: 02 Nov 2023
Need support?
Questions? Problems? Need more info? Contact Segment Support for assistance!