如何检查用户的订阅状态并捕获标识符?

Web push does not capture any identifier. We know finding an identifier that can link to the CRM or Database is essential. So in this guide, we will explain how you can check if your website visitor is a web push subscriber. Then you can capture the identifier and map it to your Database or CRM.

Checking if Website Visitor is Push Subscriber

There is a simple JavaScript API – User Subscription Status, which tells whether or not a person is a web push subscriber.

window._peq.push(['subscriber-status',function(res){
    if(res.statuscode==1)
    {
      // Code to return response
      console.log(res);
    }
}]);

The subscriber hash (Subscriber identifier) and the status code are added to the response code. This can be saved from the javascript variable and later mapped in your database. A Subscriber hash is the unique identifier of web push notifications that can be used for deeper API integrations.

Note: However subscriber hash keeps refreshing periodically, so if you are using it for any integrations, make sure you have some monthly or quarterly checks to update the hash in your CRM.

Mapping a Profile ID

There is another alternative instead of mapping our subscriber hash and keeping a periodic check. You can map your Database ID or CRM ID as Profile ID in our system against the subscribers. This way, you can get a broader spectrum to use segments saved in your database or CRM to trigger push notifications.

The process remains the same to check the subscription status. However, you can use our Adding a Profile ID Javascript API within the same callback.

Here is how the sample code would look like –

window._peq.push(['subscriber-status',function(res){
    if(res.statuscode==1)
    {
      // Code to return response
      console.log(res);
      window._peq.push(["add-to-profile", "profileId"]);

    }
}]); 

Here the Profile ID would be the exact ID you want to pass as a dynamic parameter.

Sending Notifications through REST API

You need to get your API Key if you have not fetched it from Dashboard. If you want to send notifications through API.

Navigate to Site Settings » Site Details. Scroll to API Key Section and click on Copy.

You can use REST API to send push campaigns based on the events or segments in your system once you have a mapping in place.

You can use optional parameters from the mentioned API

subscriber_hash or profile_id

This one-time integration connects your push database and customer database.

If you run into any issues, please contact us by clicking here. Our support team will be able to help you.

仍然卡住了?我们能帮您什么?
最后更新于 2026 年 3 月 9 日

在访客离开您的网站后与他们互动并挽留他们

通过难以忽略的推送通知,增加每次网站访问的价值。

  • 永久免费套餐
  • 轻松设置
  • 五星支持