Segment.com Integration

Connecting your App with Encharge via Segment.com

Sending events and creating people through Segment works best for when your app already integrates with Segment.

To get started with sending your Segment events to Encharge, open Your Apps, and click on the Segment logo.

Creating People in Encharge through Segment events

Encharge ingests all Segment events (identify, track, group, alias) that are passed to the destination you’ve set up in Segment. Encharge tries to assign the event to a person: this happens automatically through the email or the userId property, or with Segment’s anonymousId.

If no person is found, a new one is created. New people (if they have an email) are treated as subscribers automatically, i.e. eligible to receive emails.

Mapping Data from Segment events

Apart from email, userId, anonymousId , any other properties/traits in Segment events are not mapped to people in Encharge by default. However, you often might need additional data from events. To do this, in the Segment config in Encharge, the second step (Map Fields) allows you to map properties from Segment events to people in Encharge.

Let’s say that you want to be able to set the fields "Trial Start Date" and "Trial End Date" for people in your account. Your Segment event might look like this:

{ 
  type: "track", 
  userId: "019mr8mf4r", 
  event: "Started trial", 
  properties: { 
    trialStartDate: "2020-12-30T07:47:46.550Z", 
    trialEndDate: "2021-01-30T07:47:46.550Z" 
  } 
}

Then, your mapping in Encharge would be set up like this:

This will map the trialStartDate and trialEndDate from any Segment event to “Trial Start” and “Trial End” fields in Encharge.

The “Trial Ends” step in Encharge flows works with the “Trial End” field, so if this is set on some people in your account, the step will work out of the box.

Unsubscribe person through Segment events

To unsubscribe a person in Encharge, you need to set the “Unsubscribed” field in Encharge to true. Let’s say you send an event like this:

{ 
  type: "track", 
  userId: "019mr8mf4r", 
  // Event name can be anything, the unsubscribe property below makes it work 
  event: "User canceled", 
  properties: { 
    unsubscribed: true 
  } 
}

Now, you need to map the unsubscribe property from Segment to Encharge like this:

You can review other fields on your account in Fields Management.

What should my Segment events be named

In Encharge, event names in Segment events are used only when creating an Encharge “segment” based on whether an event has happened for a person. For example, with the “User canceled” event above, you might create a segment of people who have canceled:

As a best practice, set up an Event Tracking plan to know what events are going through Segment and what properties they have. Here is a sample template.

Last updated