Users (UserIDs)

Understand Users (UserIDs), their association with Devices, and user management in Pushwoosh

UserID is a unique identifier that is assigned to each user to maintain consistent user data across all their devices. This allows you to provide your audience with a seamless user experience across their devices.

Each User is assigned a unique identifier called UserID. UserIDs can be linked to multiple devices, allowing businesses to stay connected with users even when they switch devices. This ensures that targeted messages reach the intended user on whichever device they are using.

A User (UserID) is not a standalone entity; it relies on the presence of associated Devices. If the last associated Device is removed or linked to another user, the User will be automatically deleted from the system.

A User (UserID) also functions as an entity under which several devices can be grouped, each with its own unique Hardware ID (HWID).

Types of Users

There are two types of users: anonymous and known users. An anonymous user has their UserID equal to the device HWID, which can be replaced with the actual UserID later on.

A known user has a distinct UserID. You can specify a UserID when registering a new device through the /registerDevice API call.

Obtaining and managing User IDs

Pushwoosh provides several ways to access and manage Users:

Creating Users

By default, when an app with the integrated Pushwoosh SDK is launched for the first time, it sets a device HWID as a UserID. You can call the setUserId method from the Pushwoosh SDK on login to set any required value to associate a device with a particular user. When a user logs out, you can reset this value to a default one with another setUserId call, e.g. to an initial HWID value.

Importing Users

You can easily import UserIDs from a CSV file for a specific user segment. Please find our detailed instructions in the Segments guide.

Exporting Users

To export UserIDs, you can utilize the /exportSegment API request, which provides the option to export data in CSV or JSON format.

Accessing UserIDs from Device Logs

UserIDs can also be directly accessed from device logs. For step-by-step instructions, please refer to the article How to Obtain Console Logs and Device Tokens.

User and Device Tags

Just like Devices, Users (UserIDs) can have their own sets of Tags that will serve as labels to categorize and identify Users or Devices based on their characteristics.

How to create User-specific Tags

When you set a User-specific Tag, it automatically applies to both users and all their associated devices. This means the tag will be linked to the user's profile and will be reflected on all their devices.

To create a User-specific tag from the Pushwoosh Control Panel, check the User-specific checkbox when adding a new tag. If you don't mark the tag as User-specific, it will be associated with the device only.

Managing User transitions

Within Pushwoosh, managing user transitions involves two primary scenarios:

Transition from Anonymous to Known User

When an anonymous user becomes a known user, the device they are using becomes associated with their new user profile. During this transition, all device attributes remain intact. However, it's important to note that all user-specific attributes are reset to known user values or default if it does not exist.

For instance, let's consider a scenario where a guest user has been using a fitness tracking application with default settings. When they create an account, their device data remains unchanged. Still, any user-specific details, like their name, email, and customized goals, will be reset to known user values.

Transition from one Known User to another

If the User associated with a device is changed using setUserID from Pushwoosh SDK, the device is associated with the new user profile. Learn more about setting User IDs for Android and iOS. You can also use the /registerUser API call.

Just like in the previous scenario, the device attributes remain the same, ensuring a smooth transition. However, the user-specific tags will now be assigned to the values of the new user. This is to ensure that the userโ€™s tags reflect the new user's profile accurately.

As an example, consider a scenario in a video streaming service. If a registered user logs out and a different registered user logs in on the same device, the device settings, such as preferred language and video quality settings, are retained. Yet, any user-specific information, such as viewing history and recommendations, will be changed for the new user.

API methods for managing Users

Pushwoosh provides several API methods to manage users within your application. Understanding these methods is crucial for effective user data management and targeting. Here are the four key methods that change the user's status or attributes:

1. /applicationOpen

  • Creates a device without a push token and anonymous user if they do not exist.

  • Sets device-specific tags on the device.

  • Does not handle user-related changes.

2. /registerDevice

  • Creates a device with a push token and user if they do not exist.

  • Associates a device with the user from the API request (anonymous user otherwise)

  • Assigns all specified tags to both the device and its associated user.

  • To safeguard against potential race conditions (where multiple operations attempt to modify shared data simultaneously), refrain from using /registerDevice concurrently with /registerUser.

3. /registerUser

  • Creates a device without a push token and user if it does not exist.

  • Transfers a device between users while retaining device tags.

4. /setTags

  • Creates a device without a push token and anonymous user if it does not exist.

  • Assigns device tags to the device.

  • Assigns user tags to the user provided in the request (if such a user exists).

  • This method does not transfer the device, and as a result, it cannot create a new known user (you can use /registerUser method to create a new known user).

If a user is associated with multiple devices, which one will receive the message during a Customer Journey?

When a user has multiple devices associated with their account, how messages are delivered across them depends on the journey type:

Audience-based Entry and Webhook-based Entry journeys

By default, in these journeys, messages are sent to the most recently active device associated with the user. This ensures the message reaches the user who is most likely to engage with it.

Trigger-based Entry journeys

By default, the message is sent to the device where the triggering action was last fired. This maintains context and relevance by delivering the message on the device where the relevant user activity occurred.

All Devices delivery

However, you can choose to override these default settings and send the message to all devices associated with the UserID simultaneously. For this, in the message settings, scroll down to Options, and toggle on Send to all user devices.

This option might be useful for broadcasts or urgent notifications that need to reach the user regardless of which device they're currently using.

Last updated