All Collections
User and Account IDs
User and Account IDs

Best practices on how to handle User and Account IDs across your stack.

Updated over a week ago

One of the initial questions that often arises when our customers begin querying their data is: How can I combine all this data effectively? For instance, suppose you want to determine if customer support interactions in HubSpot lead to increased revenue in Stripe or calculate the percentage of accounts that both opened your email campaign and visited your website. The key to answering these advanced queries lies in the ability to connect your data sources. To achieve this, you require consistent user and account identifiers.

What is the user ID problem?

Every SaaS tool you utilize employs its unique method for identifying users, often with a unique primary key. Furthermore, these distinct IDs can be scattered across various sets of tables within your database. So, when you wish to match, for example, Elon Musk, who submitted a ticket in Zendesk and also engaged with a campaign in Mailchimp, it can become complex.

For instance, Stripe employs its own customer_id for customer tracking; requires a user_id, while MailChimp uses email to uniquely identify each individual.

To effectively establish connections across these sources, it's essential to understand how each ID relates to the others. The most effective approach is to create a common identifier that spans different tools.

Use a common identifier when possible

When integrating with a new application, you must select the field with which you'll reference the ID. There are numerous options, such as emails, Twitter handles, usernames, and more.

Nevertheless, we recommend employing the same ID that you generate from your production database when creating a new user. Database IDs remain constant, making them more reliable than emails and usernames that users can change at their discretion. Using this same database ID across as many tools as possible will simplify identity connections in the future.

analytics.identify("abc123", { // that's the user ID from the database
firstname: "Elon",
lastname: "Musk",
email: "[email protected]" // also includes email

While we would prefer to use a database ID exclusively, some tools necessitate user identification via email. Therefore, ensure that you also send the email to all your other tools, allowing you to connect based on that attribute if needed.

What happens when creates records in destinations?

Integrating as many tools as possible through will simplify future connections. When you utilize for user identification, we transmit the same ID and traits to all your connected applications when creating new records.

Most of our integration partners accept an external ID, into which they will insert the user ID and account ID. Below are some examples of destinations storing the User ID:













The same principle applies to accounts and their IDs.

How to merge identities

You don't need to worry about merging identities; handles this seamlessly. ensures that all connections maintain synchronization, taking care of the joins for you.

Did this answer your question?