Drift Destination


On this page


Drift is the world’s first and only conversational marketing platform. Instead of traditional marketing and sales platforms that rely on forms and follow ups, Drift connects your business with the best leads in real-time.

The analytics.js device-mode destination is open-source. You can browse the code on GitHub.

The cloud-mode destination is maintained by Drift. For any issues with the destination, please reach out to their team.

This document was last updated on January 25, 2019. If you notice any gaps, outdated information or simply want to leave some feedback to help us improve our documentation, please let us know!

Use Cases

Getting Started

The first step is to make sure Drift supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “Drift” within the Destinations Catalog and confirm the Source you’d like to connect to.
  3. Drop in your API Key and Embed ID as obtained from your Drift account (if Drift account not accessible yet, please email the team to get a link for the Drift account creation).
  4. If you’re using analytics.js and ‘identify’ users by default, Drift will work automatically. If you don’t have analytics.js setup, after enabling the Drift destination in Segment, you must ‘identify’ users in order for Drift to display in your product.

Page

If you haven’t had a chance to review our spec, please take a look to understand what the Page method does. An example call would look like:

analytics.page();

When you send a page or screen event, we will send that event to Drift as a custom event with the name Page - NAME where name is the name field from Segment.

Identify

If you haven’t had a chance to review our spec, please take a look to understand what the Identify method does. An example call would look like:

analytics.identify('ksc2303', {
  name: 'Tak',
  email: 'test@forestry.com'
});

When you identify a user, we’ll transform it into a Drift identify call. Segment’s special traits that are renamed as Drift attributes are (Drift attributes in parentheses):

  • createdAt (startDate)
  • title (employmentTitle)
  • description (bio)

We will also flatten the address field. All other attributes are passed through as Drift Attributes.

If you do not pass a userId, we will try to fill it in with the id or username special traits.

Keep in mind, we strongly suggest to ensure that the email field is passed in the identify call.

Track

If you haven’t had a chance to review our spec, please take a look to understand what the Track method does. An example call would look like:

analytics.track('Product Purchased', {
    product_name: 'sample2b',
    price: 99.95,
    currency: 'EUR'
});

When you track an event, we will send that event to Drift as a custom event.

Group

If you haven’t had a chance to review our spec, please take a look to understand what the Group method does. An example call would look like:

analytics.group('companyId123', {
  name: 'Segment'
});

When you send a group event, we will send that event to Drift as two identify calls. One identify call where the companyId is set to the groupId and the traits are set to the attributes, and another to map the user to that company.

Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Settings

Segment lets you change these destination settings from your Segment dashboard without having to touch any code.

API Key

Head right to this page in Drift and click connect to setup Drift in Segment.

Embed ID

Head right to this page in Drift and click connect to setup Drift in Segment.

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account