# User Id React Native

**URL:** <https://community.piwik.pro/t/user-id-react-native/2846>\
**Category:** Data collection and tags\
**Created:** [September 6, 2023, 10:09am UTC](https://community.piwik.pro/t/user-id-react-native/2846 "2023-09-06T10:09:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AudreyR](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@AudreyR](https://community.piwik.pro/u/AudreyR)\
**Post date:** [September 6, 2023, 10:09am UTC](https://community.piwik.pro/t/user-id-react-native/2846/1 "2023-09-06T10:09:03Z")

</div>

Hi there,

We build an app using React Native and have an issue regarding User ID.  
We follow all the appropriate documentation in order to set this id but it doesn’t work.  
Here is the documentation we used :

> **[Piwik PRO SDK for React Native](https://developers.piwik.pro/en/latest/data_collection/mobile/Piwik_PRO_SDK_for_React_Native.html#user-id)**
>
> Piwik PRO SDK for React Native Installation: Configuration: In order to set up the Piwik PRO tracker you have to call init method passing a server address and website ID (you can find it in Adminis...

Is someone facing the same issue ? What could we do to unlock the situation?

Regards,  
Audrey

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [September 6, 2023, 10:22am UTC](https://community.piwik.pro/t/user-id-react-native/2846/2 "2023-09-06T10:22:58Z")

</div>

Hi @AudreyR,  
Welcome to our community!

Could you please share more details on how you implement it and test it?

Best,  
Oliwer

---

<div class="post-metadata">

**Author:** ![AudreyR](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@AudreyR](https://community.piwik.pro/u/AudreyR)\
**Post date:** [September 6, 2023, 11:23am UTC](https://community.piwik.pro/t/user-id-react-native/2846/3 "2023-09-06T11:23:02Z")

</div>

Sure,

here is the code used by the developer :  
await PiwikProSdk.setUserId(“userIdString”)

- he makes sure that the userId value is a string and set it on every scree
- maybe there is one missing method on is side ?

For the tests :

- I checked directly the hit sent via browserstack
- I also checked on piwik reports but couldn’t find any user id
- I’ll attached you one request on a screen. The userId value should be the one you see on dimension8  
 ![Capture d’écran 2023-09-06 à 13.20.35](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/f/f21d9781151c1a3e0e6df75839d6d848fabf975c.png)  
 ![Capture d’écran 2023-09-06 à 13.20.23](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/f/ffc262741cbefa56cc45f8cd20c9ff5d9644066f.png)  
Many thanks for your help  
Audrey

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [September 6, 2023, 12:38pm UTC](https://community.piwik.pro/t/user-id-react-native/2846/4 "2023-09-06T12:38:38Z")

</div>

The problem here is that `userID` will not be sent if the data anonymization is enabled.  
To fix the issue you have to turn off anonymization for visitors that you want to have `userID` value.

Best,  
Oliwer
