Drift
Attribution data for Drift
See which channels drive chat conversations.
Your website
Script installed
SourceTag
Captures attribution
JS API
Reads cookie data
Drift
Data arrives tagged
Your website
Script installed
SourceTag
Captures attribution
JS API
Reads cookie data
Drift
Data arrives tagged
The problem
Drift captures conversations but not which campaign drove the visitor.
How to set it up
Use SourceTag's JavaScript API to pass attribution data into Drift contact attributes.
Install SourceTag
Add the script tag to your site.
Pass data to Drift
Use the JS API to set Drift contact attributes with attribution data.
View in Drift
Check contact profiles for attribution data.
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
Chat tools don't use traditional forms. Instead, you use SourceTag's JavaScript API to read attribution data from the cookie and push it into Drift's contact properties.
Call window.__sourcetag?.getFC() and window.__sourcetag?.getLC() to get first and last click attribution data as JavaScript objects. Then pass the values into your chat tool's API.
It helps. The JS API integration needs a small amount of JavaScript. We have code examples in the docs to keep it straightforward.
Related integrations
Done-for-you attribution. Set up in 5 minutes.
14-day free trial. No credit card required. Every lead tagged with the source that created it.
