Follow

Segment FAQ

Below is a collection of common questions we receive regarding Autopilot's Segment integration. If you haven't yet connected Segment to Autopilot, you can learn how to do so here.

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 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 the userId; 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, we encourage you to voice your support for other methods here.

Does Autopilot send out track events with the original User ID?

No. As Autopilot has its own User ID, we send this ID in the track event (e.g. contact_person_123456).

If you need to know which Autopilot User ID is the same as a User ID sent to us from your system, we send out an alias command to Segment with references to Autopilot User ID and the one received.

For example, if you sent a Track event to us with the User ID "foobar", and we create or update an Autopilot contact who has the User ID "contact_person_0597137-9F20-4F3A-BD4D-8789E6FD3F51", then we send out:

analytics.alias
previousId: "foobar"
userId: "contact_person_0597137-9F20-4F3A-BD4D-8789E6FD3F51"

On your receiving end, you can save the connection to the new User ID and reference it the next time it comes through. In doing so, you can ensure that the event will always belong to the correct user.

Have more questions? Submit a request

Comments