How to send Knock data to Segment
This guide covers how to use our Segment extension to send Knock's normalized notification data into Segment 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 Segment (e.g. Notification delivered
, Notification seen
, Notification read
) which you can then use in your downstream tools.
Knock also provides a separate integration for using Segment as a Knock source to bring track
and identify
event data from Segment into Knock to power your notifications. You can learn more in our Segment source docs.
Getting started
Knock uses the Segment HTTP Source to send events to your Segment account. Each HTTP Source has a Write Key associated with it that Knock can use to push events into Segment. A best practice is to create a separate Segment HTTP Source for each Knock environment from which you plan to collect events.
- Create a new Segment HTTP Source in your Segment Account for each Knock environment from which you plan to collect events
- Log into Segment, click Connections > Sources, and then choose "Add Source"
- Find the "HTTP API" source and click "Add Source"
- Give it a useful name, e.g. "Knock Production"
- Make note of the write key
- Repeat these steps for each Knock environment you need to configure
- Visit the Integrations page in your Knock account and go to the Extensions tab
- Find the Segment extension and click "Connect"
- In the modal that appears, enter the write key 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 Segment
Events sent to Segment
When connected, Knock will forward the following track
events to Segment.
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 Segment Track spec for the event data we pass to Segment. You can find an example payload of what you can expect from Knock events coming into Segment below.