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.

Enterprise plan feature. The Knock Segment extension is only available on our Enterprise plan.

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.

  1. Create a new Segment HTTP Source in your Segment Account for each Knock environment from which you plan to collect events.
    1. Log into Segment, click Connections > Sources, and then choose Add Source.
    2. Find the "HTTP API" source and click "Add Source".
    3. Give it a useful name, e.g. "Knock Production".
    4. Make note of the write key.
    5. Repeat these steps for each Knock environment you need to configure.
  2. Visit the Integrations page in your Knock account and go to the Extensions Tab.
  3. Find the Segment extension and click "Connect".
  4. 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.
  5. Once you click save, events will begin flowing from that environment to Segment.
Segment extension configuration example

Events sent to Segment

When connected, Knock will forward the following track events to Segment.

Notification sentOccurs when a message is successfully sent to a channel provider.
Notification deliveredOccurs 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 undeliveredOccurs when a message delivery attempt fails permanently. Delivery will not be retried.
Notification seenOccurs when a message is seen by its recipient.
Notification unseenOccurs when a message is marked unseen by the recipient.
Notification readOccurs when a message is marked as read by its recipient.
Notification unreadOccurs when a message is marked unread by the recipient.
Notification archivedOccurs when a message is archived by its recipient.
Notification unarchivedOccurs when a message is unarchived by its recipient.
Notification clickedOccurs when a link is clicked by the message recipient. This is only available when Knock link tracking is enabled.
Notification interactedOccurs 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.