How to use Segment with Autopilot

Autopilot's Segment integration allows you to:

  • add and update contacts via Segment;
  • trigger Journeys using events (referred to as a Track call in Segment) that occur in your web or mobile app; and
  • send events back to Segment in your Journeys.

How to Connect to Segment

1. In Autopilot, navigate to Settings and then under App Connections, click Segment


2. Click "Connect to Segment":


3. You will be asked for the "Write Key". You can locate the Write Key in Segment by going to the "Settings" tab for a Source, and then "API Keys":


4. Copy the Write Key into Autopilot and click "Save":


5. In Segment, under the relevant Source, select Integrations and then search for and select Autopilot:


6. Follow the steps below to copy your API Key from Autopilot into Segment and activate the integration:


7. The next step is to configure your field mappings:


Configure each Segment property to match the corresponding Autopilot field:


"Segment Property" in this context is used as a general term for a "trait" in the case of an Identify, and a "property" in the case of a Track. Track properties will always take priority if there is a matching Track and Identify property.

When you are finished remember to click "Update Field Mappings" on the right hand side to save your changes.

Please note that:

  • by default, we require an email address in the Identify. This allows us to have at least one form of communication with the contact. We also recommend including an email address in your Track calls. This ensures that if we receive the Identify and the Track call out of order, we'll know which contact to identify the event with;
  • your email property might be "email_address" as opposed to "email". Check the event Identify traits before setting this up; and 
  • if you need to map objects with more than one tier you can learn how to do so here.

How to Send Identify and Track Calls to Autopilot From Your Web or Mobile App

To learn about tracking events using Segment please consult their documentation.

Example of Identify and Track Calls Using Javascript

Below is an example of an Identify and Track using Javascript. Note how the userId in both the Identify and Track must match. Follow this link to copy and paste the below code if you need an example.


For more examples in different frameworks please consult Segment’s documentation.

How to Trigger a Journey Using an Event

1. Create a Journey and drop the Segment Event trigger on the canvas. Enter the event name, and then connect it to the action you'd like to perform:


2. You can set the trigger to only start the Journey when the event contains certain properties. For example, below is an example of a trigger that would fire when a plan is "enterprise":


3. Publish your Journey and then test it by sending an event to Segment. You will know the event is working as it will be shown in the Activity Feed:


Note that only the Activity Feed will only display events that are used on a trigger in a published Journey.

How to Send a Segment Event From Autopilot

1. Add a trigger to your Journey and connect it to the Send Event action. Give the event a memorable name:


2. You can also send properties with the event. Property values can use variables from any contact field using "--" before a variable and after the variable:


How Segment Events Sent From Autopilot Handle Identify

When you send an event from Autopilot we will send an Identify along with the event:

UserId: userID

If you wish to pass other custom information we recommend you do this via the event's properties as demonstrated above. 

When Will Autopilot Add Or Update Contacts From Segment?

A new contact will be added (or new information appended to an existing contact if they already exist) on all Identify calls. This can be modified in the Advanced Options.

All contacts added via Segment will appear in a list called "Segment Contacts":


Questions? View our article on Troubleshooting Segment

Have more questions? Submit a request