Autopilot: FAQ - Segment Destination
Below is a collection of common questions we receive regarding Autopilot's Segment Destination integration.
If I already have Segment installed on my website, do I still need to add the Autopilot tracking code?
Yes. Doing so will allow you to:
- see the web pages that both anonymous and knownc ontacts visit;
- measure marketing campaign performance by tracking UTM parameters;
- create smart segments and trigger Journeys based on the web pages that contacts visit;
- capture forms; and
Without the Autopilot tracking code, you can still:
- map traits or properties (in Identify and Track calls, respectively) to Autopilot fields; and
- trigger Journeys with Track calls
by adding Autopilot as a Segment Destination.
How can I change a contact's email address via Segment?
You can do this via an Identify or Track event.
In either case, you'll need to provide the original email address, as well as the new email address. The only difference between the two is that one will live in "traits", and the other inside "properties".
For Identify:
traits: {email: "original@email.com",_NewEmail: "new@email.com"}
For Track:
properties: {email: "original@email.com",_NewEmail: "new@email.com"}
Note: it is perfectly fine to include your usual other traits/properties alongside the email fields; this does not have to be an email change specific event.
Does Autopilot support Anonymous ID?
Yes, we accept Anonymous ID if you do not yet have the User ID available to use. You can send the Anonymous ID much like you would a User ID:
analytics.identify { anonymousId: "anonymous_12345" traits: { first_name: 'foo' last_name: 'bar' email: "foobar@autopilothq.com" } } analytics.track { anonymousId: "anonymous_12345" event: 'event' properties: { first_name: 'foo' last_name: 'bar' email: "foobar@autopilothq.com" } }
At the time when you have access to a User ID, simply switch back to using it instead of Anonymous ID:
analytics.identify { userId: "new_user_12345" anonymousId: "anonymous_12345" traits: { first_name: 'foo' last_name: 'bar' email: "foobar@autopilothq.com" } }
Note: it is up to if you wish to send both the
anonymousId
as well as theuserId
; we'll accept both and merge the existing contact information with the new based on the email address you provide.How do I map multi-level properties?
A multi-level property is an object with several layers of information.
Two tiered objects
For example, as per Segment's documentation, "address" is a two-tiered object:
The street address of a user. This should be a dictionary containing optional city, country, postalCode, state or street.
To map this object you can either use address[country] or address.country.
Here's an example of how you would map to Autopilot's MailingCountry field (note that in the screenshot below these are alternatives):
Objects with more than two tiers
To map an object with more than two tiers, for example:
traits: { membership: { foo: 'bar', level: { code: 'platinum', name: 'Platinum' } } }
You can either use membership[level][code] or membership.level.code.
Here's an example of how you would map using each of these formats:
Does Autopilot accept other methods, such as Page?
Not currently; however the Autopilot tracking code tracks page visits and more. We encourage you to voice your support for other methods here.