Heap
Server-side event and user property delivery to Heap via the Server-Side API for product analytics and digital experience insights.
This integration is currently in beta. Configuration and behaviour may change.
Prerequisites
Before configuring Heap in Datafly Signal, you need a Heap account, a project, and your App ID and API key.
Step 1: Create a Heap Account
- Go to heap.io and click Get Started or Sign Up.
- Complete the registration with your email or SSO provider.
- Follow the onboarding wizard to set up your first project.
Step 2: Create a Project
- In the Heap dashboard, click the environment selector in the top-left corner.
- Click Manage Environments.
- You will see your default environments (Production, Development). Each environment has its own App ID.
- Select the environment you want to use for Datafly Signal events (typically Production).
Heap uses “environments” rather than “projects”. Each environment has a separate App ID and data is isolated between environments. Use the Development environment for testing before switching to Production.
Step 3: Find Your App ID
- Click the Settings gear icon in the bottom-left sidebar.
- Go to Account > Manage > Environment.
- Your App ID is displayed on the environment settings page (a numeric string, e.g.
1234567890). - Copy this value.
Step 4: Generate a Server-Side API Key
- In Settings, navigate to Account > Manage > API Keys.
- Click Generate API Key (or locate an existing server-side key).
- Copy the API key. This key authenticates server-side track and identify calls.
The server-side API key is different from the App ID. The App ID identifies your environment, while the API key authenticates API requests. Both are required for the Datafly Signal integration.
API Endpoint
POST https://heapanalytics.com/api/track (events)
POST https://heapanalytics.com/api/add_user_properties (user properties)Events and user properties are sent as JSON payloads to the Heap Server-Side API. Authentication is handled via the app_id field in the request body.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
app_id | string | Yes | Your Heap environment’s App ID. Found in Account > Manage > Environment settings. |
api_key | secret | Yes | Server-side API key for authenticating Heap API requests. Generated in Account > Manage > API Keys. |
Management UI Setup
- Go to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Heap or filter by Analytics.
- Click Install and fill in the required fields:
- Enter your App ID from Step 3.
- Paste your API Key from Step 4.
- Click Install Integration to create the integration with a ready-to-use default blueprint.
Management API Setup
curl -X POST http://localhost:8084/v1/admin/integration-catalog/heap/install \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Heap",
"variant": "default",
"config": {
"app_id": "1234567890",
"api_key": "your_api_key"
},
"delivery_mode": "server_side"
}'Identity
Heap uses a combination of identity and anonymous user IDs to track visitors.
Anonymous Users
When a visitor has not been identified, Datafly Signal sends the Datafly anonymous_id as Heap’s user identifier. This creates an anonymous user session in Heap.
Identified Users
When your application calls _df.identify(userId), the user ID is forwarded to Heap as the identity field. Heap merges the anonymous and identified user profiles, attributing prior anonymous activity to the known user.
_df.identify("user-123", {
email: "[email protected]",
plan: "premium"
});Event Mapping
Datafly Signal maps standard events to Heap:
| Datafly Event | Heap Event | Notes |
|---|---|---|
page (page view) | pageview | Includes page URL, title, referrer as event properties |
Product Viewed | Product Viewed | Product details as event properties |
Product Added | Product Added | Product details as event properties |
Order Completed | Order Completed | Revenue, order ID, items as event properties |
identify | add_user_properties | User traits sent via the user properties API |
| Custom events | Passed through | Any _df.track("event_name") is sent with its original name |
User Properties
When _df.identify() is called with traits, those traits are sent to Heap as user properties via the add_user_properties API endpoint:
_df.identify("user-123", {
email: "[email protected]",
company: "Acme Inc",
plan: "enterprise"
});This results in a Heap API call:
{
"app_id": "1234567890",
"identity": "user-123",
"properties": {
"email": "[email protected]",
"company": "Acme Inc",
"plan": "enterprise"
}
}User properties persist on the user profile and are available for segmentation and analysis in the Heap dashboard.
Testing
Once your integration is active and events are flowing, verify in Heap:
- In the Heap dashboard, go to Users and search by identity (user ID) or look for recent anonymous users.
- Click on a user to view their Event Feed — events should appear in near real-time.
- Verify that event properties are populated correctly on each event.
- Check User Properties on the user profile to confirm traits from
identifycalls. - In Datafly Signal, check the Delivery Logs for the Heap integration to verify successful API responses.
Heap processes server-side events in near real-time. Events typically appear in the dashboard within 1-2 minutes.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 authentication error | Invalid App ID or API key | Verify the App ID and API key match the correct environment in Heap settings |
| No events appearing | Wrong environment selected | Ensure you are viewing the correct environment (Production vs Development) in the Heap dashboard |
| User properties not updating | Using track instead of add_user_properties | Verify that identify calls are mapped to the add_user_properties endpoint |
| Duplicate users | Identity not set | Ensure _df.identify() is called with a consistent user ID to merge anonymous and identified sessions |
| Event properties missing | Property name exceeds 1024 characters | Shorten property names — Heap has a 1024-character limit on property names |
400 bad request | Malformed JSON payload | Check Datafly Signal delivery logs for the full error message |
| Events delayed | Heap processing lag | Server-side events may take 1-2 minutes to appear; wait and refresh |
Delivery
Events are delivered server-side from your Datafly Signal infrastructure directly to the Heap Server-Side API. No client-side Heap scripts are loaded for this integration.
Visit the Heap Server-Side API documentation for full API reference and advanced configuration options.