Drift is all about meeting your customers where they are to facilitate great conversations. To that end, you may want to add Drift to your web application. While installing Drift into any web-app is an easy lift, you may want to take it a step further and start identifying your users and sharing this data with Drift to enhance your customer’s experience!
Billing Plan: Drift.Identify can be used on all Drift plans
Intended Audience:
In this doc we'll cover:
- How to use Drift.identify
“But wait, why would I want to pass identity data into Drift?”
In an out of the box Drift experience, you may notice we identify visitors based on an anonymous session-based cookie. This means we’re not de-duping on email within Drift’s UI, and if you get a repeat visitor who clears their cache in between sessions, changes devices, or otherwise deliberately obfuscates their identity, you’ll see a new contact for each engagement.

However, with a handy function called drift.Identify, you can feed an external identifier from your app into Drift and help us create a consistent contact profile for your user. That way, we can collect data about your user within your app and, over time, serve up personalized content based on that behavior.
“Okay, I’m in. What do I need to do?”
The drift.identify function is perfect for logged-in use cases and is invoked before Drift is fully loaded. If you’re using Drift in your own application, this is a good way to make sure both platforms have a good understanding of your end-user..This opens up the chance for more nuanced segmentation in Drift based on attributes you gather and events you track within your app.
Note: If you plan on using drift.identify, please insure you're using all lower case letter. Drift functions are case sensitive.
Here’s an example drift.identify call.
yourapp.login(...).then(yourUserObject => {
drift.identify(yourUserObject.id, { // assuming your DB identifier could be
something like a GUID or other unique ID.
email: yourUserObject.email,
name: yourUserObject.name,
age: yourUserObject.age,
// ...
})
})
In most cases, we’ll want to use drift.identify shortly after your user logs into your app with their user credentials. That way, you can use the data returned in your log-in flow to build out your drift.identify call.
Keep in mind, identifying your visitors programmatically leaves room for improper identification or even malicious impersonation of users. To that end, we have two requirements for using drift.identify.
First and foremost, secure your identify calls with Signed Identities. With this functionality, Drift will provide a signing key within your account you can use to create JSON Web Tokens to prove the identify call is coming from your site and matches up with your intended user. For more information on JWTs, check out this link.
Secondly, use a unique identifier, preferably unguessable, when passing an externalId into Drift. That way, you can prevent accidental collision of user identities. Usually, the best fit for this externalId is a UUID ( Universally Unique Identifier) stored in your database.
When thinking about implementing drift.identify in your app, please reach out to your Customer Success Manager to schedule a call with Drift’s Solution Engineering team. We’re happy to help guide you through this process and figure out the best strategy for you.