> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cometly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Drift integration

> Send new Drift chat contacts to Cometly and map them to the event of your choice, so you can see which ads and channels start conversations.

## Start here

Set up the [Drift](https://www.salesloft.com/welcome-drift) integration to send new chat contacts (with email addresses) to Cometly and map them to the event of your choice.

> [!NOTE]
>
> The Drift card is not shown on the **Integrations** page for most spaces. If you do not see it, [contact support](https://docs.cometly.com/support/contact.md).

### How it works

Cometly automatically creates two new attributes in your Drift account at the contact level: **Cometly Tracking Token** and **Cometly Space ID**. When a new lead with an email address is created through Drift, Drift sends the contact to Cometly. The Cometly Tracking Token links the lead back to their original journey.

## Step 1: Authenticate with Drift

1. In Cometly, click **Integrations** in the sidebar. Find the **Drift** card (it is in the **Chat** category) and click **Connect**.

   ![Connections list on the Cometly Integrations page with an arrow pointing at the Add Integration button](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/drift/01.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=8d1a970944365a90e92ff635572fc475)

   The Drift page opens.

2. Under **Connect your Drift account**, click **Sign in with Drift** and authorize Cometly in Drift.

3. When you return to Cometly, the page shows **Drift connected**. If you ever need to refresh the connection, click **Re-sync Drift**.

   ![Drift integration page in Cometly with an arrow pointing at the Sync button above the code snippet](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/drift/03.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=be139e75d69b5c6ef9b5524dd9d04849)

## Step 2: Place the tracking code on your website

The tracking code fills in the Cometly Tracking Token and Cometly Space ID attributes for new contacts from Drift.

On the Drift page in Cometly, under **Add the tracking snippet to your website**, click **Copy snippet to clipboard**. Paste the code right before the closing `</body>` tag on every page where the Drift widget loads.

![Drift integration page in Cometly with the Copy Snippet To Clipboard button highlighted](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/drift/04.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=5e0052ec7348be8aa22c32fce8f3c892)

## Step 3: Map new leads from Drift to a Cometly event

On the Drift page in Cometly, under **Map Drift events to Cometly**, choose the Cometly event that new Drift leads should be mapped to and click **Save**.

![Event mapping card with Contact Identified mapped to the Lead event and a Save button](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/drift/05.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=e7afacbe204c756097555083ed6c9ebf)

### Important considerations for event mapping

When you send **Lead** events to Cometly from Drift and other platforms, consider the following:

1. **If Drift leads are already in your CRM**

   * If your CRM (for example HubSpot) already sends Drift leads as part of its **Lead** events, create a separate event in Cometly, such as **Chat Lead**, for Drift.
   * You then see both **Lead** (from your CRM) and **Chat Lead** (from Drift) on the contact's timeline, which avoids duplicates.

2. **If leads are sent from multiple sources**

   * If you send **Lead** events from different sources (for example forms, Drift and your CRM), you can include Drift leads in the general **Lead** event.

Choose the setup that best fits your workflow to keep your tracking clear and accurate.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.