オプトインで許可またはブロックをクリックした後に別のページにリダイレクトする

Sometimes you want to redirect a user to a landing page once they complete the Web Push subscription or if they have denied it. This is possible to create using our Web SDK.


We will share the required steps to be followed in that case.

Our typical installation code looks like this

<script> window._peq = window._peq || []; window._peq.push([“init”]); </script><br><script src=”https://clientcdn.pushengage.com/core/4xxxyoursitexx.js” async></script>

Instead of adding that please add the below code

1) Replace URL https://yourredirectpage.com with the page you want to redirect to

<script> window._peq = window._peq || [];
window.addEventListener('PushEngage.permissionPrompt.allow', function (event) {
  if (event.detail && event.detail.prompt === 'native') {
    setTimeout(() => {
      window.location = 'https://yoursite.com';
    }, 6000);
  }
});< /script> 
<script src = ”https: //clientcdn.pushengage.com/core/4xxxyoursitexx.js” async>

So specifically, the first line of code is replaced by the sample code snippet for redirection

<script> window._peq = window._peq || [];
window._peq.push([‘init’,{}.pe,function(res){
if(res.statuscode==1){ location = “https://yourredirectpage.com“;
}
if(res.statuscode==2 || res.statuscode==3){
location = “https://yourredirectpage.com“;
}}]);

The second line remains the same from your Settings » Site Settings > Installation Settings

<script src=”https://clientcdn.pushengage.com/core/4xxxyoursitexx.js” async></script>

That is it, you should be able to drive people to any landing page after they click allow/block ; try it out & hope it works well.

万が一問題が発生した場合は、ここをクリックしてお問い合わせください。サポートチームがお手伝いします。

最終更新日:2026年3月9日

ウェブサイトを離れた後も訪問者をエンゲージし、維持する

見逃せないプッシュ通知で、すべてのウェブ訪問の価値を高めましょう。

  • 永久無料プラン
  • 簡単なセットアップ
  • 5つ星サポート