All Collections
Data Collection & GDPR
Data Collection
What kind of user ID should I use as a custom user ID in Batch?
What kind of user ID should I use as a custom user ID in Batch?
Selma avatar
Written by Selma
Updated over a week ago

Batch allows you to store a Custom User ID that can automatically be tied to several push tokens from different OS' and Apps (web, mobile). This allows you to use the Custom Data API. This is also useful if you are planning to use the Transactional API and don't want to manage devices' tokens on your side.

The Custom User ID you communicate to Batch should be a unique ID that you use to identify your users across different tools and databases in your technical ecosystem. This ID will allow you to connect Batch and your other tools (internal and external).

If you are wondering which ID you should use as a custom user identifier, here are a few examples:

Login System

If you have a login system, you probably have a unique user ID associated with the user's account. Simply set this ID as your user identifier, and don't forget to reset it (by setting it to nil) when the user logs out.

While email addresses are an appropriate identifier, we suggest you hash them before setting them as your identifier, for privacy reasons.

PaaS Datastore

Your data store probably has a stable ID associated with your installation. You just need to make sure it is unique between installations, and you are easily able to retrieve it from your backend code.

Specific Backend And Database

Anything that can identify a user uniquely will work. Email address, phone number, etc. We suggest you hash this information before setting it and use the same hash on your backend.

Otherwise, you will need to create a stable identifier for your app installation and send it to your backend. The most common way to do that is to generate a RFC4122 UUID.


This article belongs to Batch's FAQ. Need more help? Find insightful articles, documentation, case & market studies, guides, and even more in our website's Resources section on batch.com and our blog.

Did this answer your question?