Player ID & Username
Using Hashed User IDs for Consistent User Identification
playgen.io provides cross-platform support, allowing clients to maintain a consistent user experience across multiple devices. By sending a hashed user ID and/or a username, clients can ensure that players are identified consistently on leaderboards and other user-specific features, even when switching between platforms. This section covers how to configure cross-platform support securely while ensuring user privacy.
How to Use Hashed User IDs and Usernames
-
Sending a Hashed User ID:
- Clients are encouraged to send a unique, hashed user ID to identify players. This ID allows playgen.io to maintain consistency in user-specific data, such as leaderboard positions, across multiple platforms and devices.
- If no
user_id
is provided, playgen.io will generate a random ID for the session. However, to enable cross-platform consistency, it’s recommended to provide your own hashed ID.
-
Using the
PLAYGEN_SESSION_INIT
Event:- To initialize cross-platform support, send a
PLAYGEN_SESSION_INIT
event with theuser_id
(hashed) andusername
(optional) parameters. However, this event should only be sent after playgen.io has dispatched thePLAYGEN_SESSION_LOADED
event. - Here’s an example:
- To initialize cross-platform support, send a
-
Wait for
PLAYGEN_SESSION_LOADED
Event:- The
PLAYGEN_SESSION_LOADED
event is dispatched by playgen.io to indicate that the game instance has been fully loaded and is ready for session initialization. - The function responsible for sending this event is as follows:
- Only after receiving this event should you proceed to send the
PLAYGEN_SESSION_INIT
event with your hasheduser_id
andusername
.
- The
-
Privacy Considerations:
- No PII Storage: playgen.io is committed to user privacy and does not store any personally identifiable information (PII). The
user_id
should be a hashed or anonymized value, ensuring it cannot be traced back to an actual user. - Random ID Generation: If no
user_id
is sent, playgen.io will generate a unique ID for each session. However, this ID will not support cross-platform consistency, so we recommend providing your own hashed ID.
- No PII Storage: playgen.io is committed to user privacy and does not store any personally identifiable information (PII). The
Benefits of Cross-Platform Support
Implementing cross-platform support offers several benefits:
- Consistent User Experience: By using a hashed
user_id
, users will see consistent scores and rankings on the leaderboard, regardless of the device they use to play. - Enhanced User Retention: Persistent IDs allow for features like saved progress, which can help increase user retention by allowing players to pick up where they left off on any device.
- Improved Engagement Tracking: With a consistent
user_id
, you can track user engagement more effectively, gaining insights into player behavior across devices.
Testing Cross-Platform Support
You can test cross-platform support and debug your integration in the Playground section of the game editor. Here, you can monitor the events sent and received, ensuring your hashed IDs and usernames are functioning correctly across different platforms.
By following these guidelines and waiting for the PLAYGEN_SESSION_LOADED
event, you can implement a secure, privacy-focused cross-platform solution that provides a seamless experience for your users on playgen.io.