Segment

Configuration details for the Segment integration.

Overview

This integration allows you to sync events (identify and track) between your sources and Segment.

Initial Setup

To find the write key for your Segment destination in Hightouch:

  1. Create a new HTTP API source in Segment

  2. Navigate to Source Settings > API Keys and copy the "Write Key".

Syncing Segment Events

Event Types

There are three types of events that can be sent to the Segment destination:

  • Track (Generic): Sends events of different names when a record is added, changed, or removed in the query results

  • Track (Segment Entered / Exited): Sends the event "Segment Entered" when a record is added and "Segment Existed" when a record is removed

  • Identify: Sends an identify event with related properties of the user

User / Anonymous IDs

It is required to send either the user or anonymous ID to Segment in order to identify the user associated with the event.

Field Mapping

You can sync columns from your source into properties of the user (identify) or properties of the event (track).

Sending Initial Results (Track Only)

For the two "Track" event types, Hightouch allows you to choose whether to:

  • Send the initial set of results as track events (as Entered / Added events)

  • Or, only send the changes between the results in the subsequent syncs as track events

Checking the "Send events for initial result set" checkbox will result in a large amount of events being sent in the first sync.

Hightouch will always send the initial set of results as identify calls when in the "Identify" event type.

Event Names and Timestamps (Generic Track Only)

For the generic track mode, there are further settings that are needed to determine which event name Hightouch will send to Segment for each added, changed, and removed record.

In this example, Hightouch will send Segment:

  • A user signed up event when a record is added to the query results

  • A user changed subscription event when a record is changed in the query results

  • A user deleted account event when a record is removed in the query results

Hightouch allows you to send a timestamp that the event occurred for generic track events. This is useful for backfilling historical events.

Higthouch also allows you to send a message ID for each record in order to ensure that the event is deduplicated within Segment in the case that the same event erroneously gets sent twice.