SubscriberID is a unique ID of the current user, exposed by the VWO Engage API, which you can map in your own database against user information like email addresses etc.
Variable pushcrew.subscriberId can be used to get the SubscriberID of current user.
If the user isn't subscribed to push notifications, its value will be false(boolean)
If the user has blocked push notifications, its value will be -1(integer)
Please Note: This variable should only be accessed when API is ready. Most preferably inside APIReady Callback
_pcq.push(['APIReady', callbackFunction]);
//some code here
function callbackFunction() {
console.log(pushcrew.subscriberId); // will return something like this if current user is a subscriber '1c5d546172cfb4be65a8d51b047c4804'
console.log(pushcrew.subscriberId); // will return false(boolean) if user is not subscribed to push notifications
console.log(pushcrew.subscriberId); // will return -1(integer) if user has blocked push notifications from your website
}
You can also access pushcrew.subscriberId after checking if pushcrew.isAPIReady evaluates to true(Boolean).
if(pushcrew.isAPIReady) {
console.log(pushcrew.subscriberId); // will return something like this if current user is a subscriber '1c5d546172cfb4be65a8d51b047c4804'
console.log(pushcrew.subscriberId); // will return false(boolean) if user is not subscribed to push notifications
console.log(pushcrew.subscriberId); // will return -1(integer) if user has blocked push notifications from your website
}
If API is not ready, and pushcrew.subscriberId is accessed, it will return null.
console.log(pushcrew.subscriberId); //returns null