Heap

Server-side event and user property delivery to Heap via the Server-Side API for product analytics and digital experience insights.

⚠️

This blueprint is currently alpha — schema and behaviour may change before GA.

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

  1. Go to heap.io and click Get Started or Sign Up.
  2. Complete the registration with your email or SSO provider.
  3. Follow the onboarding wizard to set up your first project.

Step 2: Create a Project

  1. In the Heap dashboard, click the environment selector in the top-left corner.
  2. Click Manage Environments.
  3. You will see your default environments (Production, Development). Each environment has its own App ID.
  4. 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

  1. Click the Settings gear icon in the bottom-left sidebar.
  2. Go to Account > Manage > Environment.
  3. Your App ID is displayed on the environment settings page (a numeric string, e.g. 1234567890).
  4. Copy this value.

Step 4: Generate a Server-Side API Key

  1. In Settings, navigate to Account > Manage > API Keys.
  2. Click Generate API Key (or locate an existing server-side key).
  3. 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

FieldTypeRequiredDescription
app_idstringYesYour Heap environment’s App ID. Found in Account > Manage > Environment settings.
api_keysecretYesServer-side API key for authenticating Heap API requests. Generated in Account > Manage > API Keys.

Management UI Setup

  1. Go to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Heap or filter by Analytics.
  4. Click Install and fill in the required fields:
    • Enter your App ID from Step 3.
    • Paste your API Key from Step 4.
  5. 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 datafly.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.

datafly.identify("user-123", {
  email: "jane@example.com",
  plan: "premium"
});

Event Mapping

The Retail variant maps the following events to Heap:

Datafly EventHeap EventNotes
pagepagePage URL, title, referrer sent as event properties
Product ViewedProduct ViewedProduct details as event properties
Order CompletedOrder CompletedRevenue, order ID, items as event properties
identifyadd_user_propertiesUser traits sent via the user properties API
Custom eventsPassed throughAny datafly.track("event_name") is sent with its original name

Identity

The default blueprint maps user_id to Heap’s identity field. Anonymous visitors are tracked using Signal’s anonymous identifier until datafly.identify() is called, at which point Heap merges the anonymous and identified profiles.

Default consent category: analytics.

User Properties

When datafly.identify() is called with traits, those traits are sent to Heap as user properties via the add_user_properties API endpoint:

datafly.identify("user-123", {
  email: "jane@example.com",
  company: "Acme Inc",
  plan: "enterprise"
});

This results in a Heap API call:

{
  "app_id": "1234567890",
  "identity": "user-123",
  "properties": {
    "email": "jane@example.com",
    "company": "Acme Inc",
    "plan": "enterprise"
  }
}

User properties persist on the user profile and are available for segmentation and analysis in the Heap dashboard.

Verify it’s working

  1. In the Signal Management UI, open your Heap integration and watch the Live Events stream as you trigger events on your site.
  2. Confirm 200 responses from heapanalytics.com/api/track.
  3. In Heap, open Users and click into a recent visitor — the Event Feed should populate within 1-2 minutes.

Testing

Once your integration is active and events are flowing, verify in Heap:

  1. In the Heap dashboard, go to Users and search by identity (user ID) or look for recent anonymous users.
  2. Click on a user to view their Event Feed — events should appear in near real-time.
  3. Verify that event properties are populated correctly on each event.
  4. Check User Properties on the user profile to confirm traits from identify calls.
  5. 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

SymptomCauseFix
401 authentication errorInvalid App ID or API keyVerify the App ID and API key match the correct environment in Heap settings
No events appearingWrong environment selectedEnsure you are viewing the correct environment (Production vs Development) in the Heap dashboard
User properties not updatingUsing track instead of add_user_propertiesVerify that identify calls are mapped to the add_user_properties endpoint
Duplicate usersIdentity not setEnsure datafly.identify() is called with a consistent user ID to merge anonymous and identified sessions
Event properties missingProperty name exceeds 1024 charactersShorten property names — Heap has a 1024-character limit on property names
400 bad requestMalformed JSON payloadCheck Datafly Signal delivery logs for the full error message
Events delayedHeap processing lagServer-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.

Blueprint

The Heap blueprint version is 0.1.0 (alpha). It ships with a Retail variant covering page views, product views, and orders.

See also

  • Mixpanel — alternative product analytics destination.
  • Amplitude — alternative product analytics destination.