Drift logo

Drift

Attribution data for Drift

See what brought them into the chat.

Your website

Script installed

SourceTag

Captures attribution

JS API

Reads cookie data

Drift

Data arrives tagged

The problem

Drift captures the chat. It won't tell you which campaign started the visit.

How to set it up

Read attribution data from SourceTag's JavaScript API and write it to Drift's contact attributes.

1

Install SourceTag

Add the script tag to your site.

2

Set Drift attributes

Use the JS API to pull channel and campaign data into Drift contacts.

3

Confirm it landed

Open a contact profile and look for the new attributes.

Using the JavaScript API

Chat tools don't use traditional forms, so SourceTag takes a different approach here. Instead of hidden fields, you read attribution data from the JavaScript API and pass it into Drift's contact properties.

const fc = window.__sourcetag?.getFC();
const lc = window.__sourcetag?.getLC();
// Returns: channel, source, campaign, term, ...

The API gives you the same data that hidden fields capture. See the full JS API reference →

Frequently asked questions

Related integrations

Start with one form.

The trial is 14 days and doesn't need a card.