Segment provides a single API to track customer data across multiple devices and channels and send it to third-party tools, internal systems, and data warehouses.
SetupTo find the write key for your Segment destination in Hightouch:
- Create a new HTTP API source in Segment
- Navigate to Source Settings > API Keys and copy the "Write Key".
Syncing Segment Events
Event TypesThere 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 IDsIt is required to send either the user or anonymous ID to Segment in order to identify the user associated with the event.
Field MappingYou 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:
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.
- 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
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:
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.
- 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