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.
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.
When connected, Knock will forward the following track events to Segment.
|Occurs when a message is successfully sent to a channel provider.|
|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.|
|Occurs when a message delivery attempt fails permanently. Delivery will not be retried.|
|Occurs when a message is seen by its recipient.|
|Occurs when a message is marked unseen by the recipient.|
|Occurs when a message is marked as read by its recipient.|
|Occurs when a message is marked unread by the recipient.|
|Occurs when a message is archived by its recipient.|
|Occurs when a message is unarchived by its recipient.|
|Occurs when a link is clicked by the message recipient. This is only available when Knock link tracking is enabled.|
|Occurs when a recipient interacts with a message. This is only available when Knock link tracking is enabled.|