How can I determine the Subscriber ID of a visitor to my site?

Every user that 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:

A. Right click on your website - go to Inspect - Console - type pushcrew.isAPIReady - press the Enter keyYou should get a response ‘true’B. Then type pushcrew.subscriberId - press the Enter key. You will now get the Subscriber IDIf you want to store this variable in your database using Javascript code, you can more details from this API documentation

2. Using Cookies :

For Chrome subscribers:A. Right click on your website - go to Inspect - Application. Under Storage, expand the Cookies section - click on your website linkB. 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:

A. Right click on your website - go to Inspect Element - Storage. Under Cookies, click on your website linkB. In the table that opens, under the ‘Name’ column you will find ‘wingify_push_subscriber_id’ The ‘Value’ of this is the Subscriber ID

Using Cookies through Javascript :You can also use Javascript code to fetch subscriber ID from Cookies. You can use the below Javascript to do so :

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:

A. Right click on your website - go to Inspect - Application. Under Storage, expand the Local Storage section - click on your website linkB. 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:

A. Right click on your website - go to Inspect Element - Storage. Under Local Storage, click on your website linkB. In the table that opens, under the ‘Name’ column you will find ‘wingify_push_subscriber_id’ The ‘Value’ of this is the Subscriber ID

Using Local Storage through Javascript :

You can also use Javascript code to fetch subscriber ID from Local Storage. You can use the below Javascript to do so :

subscriberID=localStorage.getItem("wingify_push_subscriber_id");

Please note that there is no way to collect the email address or any personal details of subscribers.