Provide your own user ID
If you already have a mechanism to assign a unique ID to each user, you can share this information with the justtrack SDK. This allows the backend of the justtrack SDK to associate events received from third parties via that user ID with the correct user on justtrack side. Should your user ID change for some reason, you have to supply the new value to the justtrack SDK again:
- Java
- Kotlin
String ownUserId = /* get your own user ID from your app */;
SdkBuilder builder = /* create the builder somehow */ new JustTrackSdkBuilder(this, BuildConfig.APP_KEY);
JustTrackSdk sdk = builder
.setUserId(ownUserId)
// other options...
.build();
ownUserId = /* new user ID for some reason */;
sdk.setUserId(ownUserId);
var ownUserId: String = /* get your own user ID from your app */
val builder: SdkBuilder = /* create the builder somehow */ JustTrackSdkBuilder(this, BuildConfig.APP_KEY)
val sdk: JustTrackSdk = builder
.setUserId(ownUserId)
// other options...
.build()
ownUserId = /* new user ID for some reason */
sdk.setUserId(ownUserId)
A user ID must be shorter than 4096 characters and only consist of printable ASCII characters (U+0020 to U+007E).