Follow

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

Screen_Shot_2017-06-19_at_2.11.45_PM.png

2. Click "Connect to Segment":

Screen_Shot_2017-06-19_at_2.19.05_PM.png

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":

Screen_Shot_2017-06-19_at_5.58.42_PM.png

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

Screen_Shot_2017-06-19_at_2.25.27_PM.png

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

Screen_Shot_2017-06-19_at_6.11.47_PM.png

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

Screen_Recording_2017-06-19_at_05.56_PM.gif

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

Screen_Shot_2017-06-19_at_3.33.54_PM.png

Configure each Segment property to match the corresponding Autopilot field:

Screen_Shot_2017-06-19_at_3.30.36_PM.png

"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.

Screen_Shot_2015-03-27_at_5.46.58_PM.png

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:

Screen_Recording_2017-06-19_at_03.49_PM.gif

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":

Screen_Shot_2017-06-19_at_3.59.44_PM.png

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:

Screen_Shot_2017-06-19_at_4.17.59_PM.png

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:

Screen_Shot_2017-06-19_at_4.29.42_PM.png

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:

Screen_Shot_2017-06-19_at_4.28.45_PM.png

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
traits:
Email:
FirstName:
LastName:
Company:

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":

Screen_Shot_2017-06-19_at_2.45.23_PM.png

Questions? View our article on Troubleshooting Segment

Have more questions? Submit a request

Comments