Every user who clicks on Allow and subscribes to notifications from your website is assigned a unique Subscriber ID.
There are 3 ways to determine the Subscriber ID of a visitor:
1. Using JS variable
-
Right-click on your website. Go to Inspect > Console and type
pushcrew.isAPIReadyand press the Enter key.You should get a response ‘true’.
- Then type pushcrew.subscriberId - press the Enter key. You will now get the Subscriber ID.
If you want to store this variable in your database using JavaScript code, you can get more details from this API documentation.
2. Using Cookies
For Chrome subscribers
- Right-click on your website. Go to Inspect > Application. Under Storage, expand the Cookies section and click your website link.
- In the table that opens, under the ‘Name’ column, you will find ‘wingify_push_subscriber_id’. The ‘Value’ of this is the Subscriber ID.
For Firefox subscribers
- Right-click your website. Go to Inspect > Storage. Under Cookies, click on your website link.
- In the table that opens, under the ‘Name’ column, you will find ‘wingify_push_subscriber_id’. The Value is the Subscriber ID.
Using Cookies through JavaScript
You can also use JavaScript code to fetch the subscriber ID from Cookies. You can use the following JavaScript:
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
subscriberID=getCookie('wingify_push_subscriber_id');3. Using Local Storage
For Chrome subscribers
- Right-click on your website. Go to Inspect > Application. Under Storage, expand the Local Storage section and click your website link.
- In the table that opens, under the Name column, you will find ‘wingify_push_subscriber_id’. The Value is the Subscriber ID.
For Firefox subscribers
- Right-click on your website. Go to Inspect > Storage. Under Local Storage, click your website link
- In the table that opens, under the Name column, you will find ‘wingify_push_subscriber_id’. The Value is the Subscriber ID.
Using Local Storage through JavaScript
You can also use JavaScript code to fetch the subscriber ID from Local Storage. You can use the below JavaScript to do so:
subscriberID=localStorage.getItem("wingify_push_subscriber_id");Note that there is no way to collect the email address or any personal details of subscribers.
Need more help?
For further assistance or more information, contact Wingify Support.