Retrieve User ID using SDK


Hi, is it possible to retrieve the auto generated User ID using the Android and iOS SDKs? Looking at the documentation it would appear not.

I need to find a way for the user of my App to be able to view their Countly ID but before they can do this I need to be able to retrieve it. Once they can view it they can then pass it on to customer support, thus allowing them to quickly find the user's analytics data and help resolve issues that they're facing. At the moment the User ID is automatically generated by Countly.

Any help gratefully received.



Hi Ian,

As for now there are ways, but it's rather not supported. I'd suggest switching to setting custom ID instead of autogenerated one, is this an option?


Ok, thanks. Custom ID may be a bit tricky at the moment.

It is possible for me to use the Restful Web APIs in addition to the iOS and Android APIs, do they support the function I need?

Thanks for your reply.



Countly generated IDs are quite lengthy and it may not be easy to remember / copy / paste etc.

How about generating an easier to remember ID for that user, and show it on mobile app instead so it's easier to report? Those would be custom user properties, which can be queried later via dashboard.


Thanks for the reply. Maybe I've not explained what I'm looking for very well. The ID I need is quite short, at the moment when I look at the Countly dashboard each user has an ID along the lines of #c0172, it is this that I'm looking to retrieve.



Hello Ian,
well that is not that simple :slight_smile:

Firstly what you see in user profile is only the beginning of user id, the whole user id is available in url, as

Now about how this id is generated for each user, then it is sha1 hash of app_key and device_id from sdk requests.

And it is mostly available for internal usage.

The way we usually recommend it, is to use plain device_id and use filter in User Profiles for ID property to filter by device_id.

But currently problem is that Android SDK does not support returning this device_id, we are working on new version of the SDK, redesigning it completely, and that is why current old version might be lacking some features like this.

The best workaround is to use custom property providing your internal customer id and then filter by it in user profiles filter, or use dbviewer API to fetch user id to get link directly to specific user profile, depending on your needs.

If you still want to go with device_id, then you will probably need to modify current Android SDK to be able to retrieve it programmatically.


Thank you very much for your help. It's most appreciated.



Just FYI, related links:
AP reference:

Tutorial on exporting DB using DBviewer