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, contact the Drift support team.

Getting Started

Before you start, make sure Drift supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode
  1. From the Segment web app, click Catalog.
  2. Search for “Drift” in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. In the destination settings, enter your API Key and Embed ID as obtained from your Drift account (if Drift account not accessible yet, 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’re not familiar with the Segment Specs, 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’re not familiar with the Segment Specs, 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’re not familiar with the Segment Specs, 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’re not familiar with the Segment Specs, 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 using Segment Personas to this destination as a user property. To learn more about Personas, contact us for a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Personas sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Personas sets that value to false.

When you first create an audience, Personas sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

API Key

Your API Key for your Drift account

Embed ID

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

This page was last modified: 20 Oct 2020

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