How to send Knock data to Heap
This guide covers how to use our Heap extension to send Knock's normalized notification data into Heap to forward on to your data warehouse or other tools where you run data analysis, such as Amplitude or Mixpanel.
Once the extension is enabled, Knock automatically passes a stream of track
events to Heap (e.g. Notification delivered
, Notification seen
, Notification read
) which you can then use in your downstream tools.
Getting started
Knock uses the Heap Bulk Track endpoint to send events to your Heap project environments. Each Heap project has a group of environments, and each of them has an environment id
associated with it that Knock can use to push events into Heap.
A best practice is to create a separate Heap environment for each Knock environment from which you plan to collect events.
- Create a new Heap project with environments in your Heap account. You need to create one Heap environment for each Knock environment from which you plan to collect events
- Log into your Heap dashboard, click Account > Manage > Projects, and then choose your main project
- A list of environments will appear on your right side of the screen. By default Heap creates two environments (Production and development), but you can create more if you need it
- Each environment has an
id
that will be used by Knock to send events to the given environment
- Visit the Integrations page in your Knock account and go to the Extensions Tab
- Find the Heap extension and click "Connect"
- In the modal that appears, enter the Heap environment id for each environment you want to configure. Leave the field blank to disable writing events from that environment
- Once you click save, events will begin flowing from that environment to Heap
Label custom events
Heap requires the labeling of custom received events from Knock before their use.
- From your Heap dashboard, navigate to Data > Labeled Events and click on "Label event" or Property > Event
- Select "Custom" under the source filter and choose one of the previously received events that you want to label
- Add a name for the given event and click on "Label event"
- Finally, click on "Verify event"
- Once these steps are completed, the validated event will be ready for analysis and usage in your charts
You can find more information about custom events and how to use them in the Heap documentation
Events sent to Heap
When connected, Knock will forward the following Track
events to Heap.
Event | Description |
---|---|
Notification sent | Occurs when a message is successfully sent to a channel provider. |
Notification delivered | Occurs when a message is marked as delivered to the user by the provider. This is only available on email providers with delivery tracking enabled. |
Notification undelivered | Occurs when a message delivery attempt fails permanently. Delivery will not be retried. |
Notification seen | Occurs when a message is seen by its recipient. |
Notification unseen | Occurs when a message is marked unseen by the recipient. |
Notification read | Occurs when a message is marked as read by its recipient. |
Notification unread | Occurs when a message is marked unread by the recipient. |
Notification archived | Occurs when a message is archived by its recipient. |
Notification unarchived | Occurs when a message is unarchived by its recipient. |
Notification clicked | Occurs when a link is clicked by the message recipient. This is only available when Knock link tracking is enabled. |
Notification interacted | Occurs when a recipient interacts with a message. This is only available when Knock link tracking is enabled. |
Event schema
Knock uses the Heap Bulk track endpoint for sending event data to Heap. You can find an example payload of what you can expect from Knock events coming into Heap below.