User IDs
Assign your own user IDs to integrate WonderPush with your systems
You can assign your own user IDs to installations in WonderPush. This allows you to target users by user ID and lets you tightly integrate WonderPush with your systems.
Assigning your own user IDs
Assigning your own user IDs depends on the platform (adapt THIS_USER_ID
) with your own user ID:
window.WonderPush = window.WonderPush || [];
WonderPush.push(['setUserId', "THIS_USER_ID"]);
WonderPush.setUserId("THIS_USER_ID")
[WonderPush setUserId:@"THIS_USER_ID"];
WonderPush.setUserId("THIS_USER_ID");
WonderPush.setUserId("THIS_USER_ID");
Changing user ID
There are cases where the current user ID can change:
- when anonymous users log into your app / website, user ID goes from
null
to something, - when the user logs in with another account.
When the user ID changes, a new installation is created. This means that all the tags, properties and events you've sent before changing the user ID will not be attached to the new installation. This ensures that data doesn't get mixed up between different user accounts.
Targeting users with the API
You can use the targetUserIds
parameter of the Send notifications API call to target one or more users.
Targeting users via the online dashboard
To target one or more users from the target tab of the notification edition interface, setup a criterion of type User id is equal to.
Updated 3 months ago