{"id":3573,"date":"2026-11-26T10:11:14","date_gmt":"2026-11-26T04:41:14","guid":{"rendered":"https:\/\/larapush.com\/blog\/?p=3573"},"modified":"2026-11-26T10:11:14","modified_gmt":"2026-11-26T04:41:14","slug":"open-url-on-web-push-click","status":"publish","type":"post","link":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/","title":{"rendered":"How to Open a Specific Page When Someone Clicks a Web Push Notification"},"content":{"rendered":"\n<p><strong>To open a specific page when someone clicks a web push notification, put the URL in the notification&#8217;s data field, then handle the notificationclick event in your service worker. Close the notification, check for an open tab with clients.matchAll(), and focus it, or call clients.openWindow(url) to open a new tab.<\/strong><\/p>\n\n\n\n<p>A notification that opens the homepage instead of the article it promised loses the click. I see this a lot on custom web push setups, usually because the click handler was copied from a tutorial and never passed the link through. Here&#8217;s how the web push click URL works, the code that handles it properly, and how to send people to different pages from action buttons.<\/p>\n\n\n\n<p>Key facts at a glance:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clicks are handled in the service worker<\/strong>, not on the page, through the notificationclick event.<\/li>\n\n\n\n<li><strong>The browser doesn&#8217;t open a link for you.<\/strong> Unless you call clients.openWindow(), a click just closes the notification (or does nothing).<\/li>\n\n\n\n<li><strong>Pass the URL in data<\/strong>, because the Notification object has no built-in link property in the classic Push API.<\/li>\n\n\n\n<li><strong>Up to two action buttons<\/strong> can each open a different page in Chrome and Edge; event.action tells you which one was clicked.<\/li>\n\n\n\n<li><strong>Safari&#8217;s Declarative Web Push<\/strong> (iOS and iPadOS 18.4 and later) adds a navigate URL in the payload itself, described on the <a href=\"https:\/\/webkit.org\/blog\/16535\/meet-declarative-web-push\/\" target=\"_blank\" rel=\"noreferrer noopener\">WebKit blog<\/a>.<\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_63 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#How_does_a_web_push_click_open_a_page\" title=\"How does a web push click open a page?\">How does a web push click open a page?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#How_do_you_pass_the_URL_in_the_notification\" title=\"How do you pass the URL in the notification?\">How do you pass the URL in the notification?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#How_do_you_handle_the_notificationclick_event\" title=\"How do you handle the notificationclick event?\">How do you handle the notificationclick event?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#Should_you_open_a_new_tab_or_focus_an_existing_one\" title=\"Should you open a new tab or focus an existing one?\">Should you open a new tab or focus an existing one?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#How_do_action_buttons_open_different_pages\" title=\"How do action buttons open different pages?\">How do action buttons open different pages?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#Why_does_clicking_a_web_push_notification_open_the_wrong_page\" title=\"Why does clicking a web push notification open the wrong page?\">Why does clicking a web push notification open the wrong page?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#Where_LaraPush_fits\" title=\"Where LaraPush fits\">Where LaraPush fits<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#Frequently_asked_questions\" title=\"Frequently asked questions\">Frequently asked questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_does_a_web_push_click_open_a_page\"><\/span>How does a web push click open a page?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>A click on a web push notification fires the notificationclick event in the service worker that showed it. Your code reads the target URL from the notification and decides whether to open a new tab or reuse an existing one. Nothing opens automatically.<\/p>\n\n\n\n<p>The full path looks like this:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Your server sends a push message whose payload includes a URL.<\/li>\n\n\n\n<li>The service worker&#8217;s push handler calls showNotification() and stores the URL in data.<\/li>\n\n\n\n<li>The subscriber clicks the notification or an action button.<\/li>\n\n\n\n<li>The notificationclick handler closes the notification and opens or focuses the right page.<\/li>\n<\/ol>\n\n\n\n<p>The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/ServiceWorkerGlobalScope\/notificationclick_event\" target=\"_blank\" rel=\"noreferrer noopener\">MDN notificationclick reference<\/a> and the <a href=\"https:\/\/web.dev\/articles\/push-notifications-common-notification-patterns\" target=\"_blank\" rel=\"noreferrer noopener\">web.dev guide to notification behaviour<\/a> both document this pattern.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_you_pass_the_URL_in_the_notification\"><\/span>How do you pass the URL in the notification?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Send the URL in your push payload, then copy it into the data option when you show the notification. The data value is stored with the notification, so the click handler can read it later, even if the service worker restarted in between.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>self.addEventListener('push', (event) =&gt; {\n  const msg = event.data ? event.data.json() : {};\n  event.waitUntil(\n    self.registration.showNotification(msg.title || 'New post', {\n      body: msg.body,\n      icon: msg.icon,\n      data: { url: msg.url || '\/' },\n      actions: [\n        { action: 'read', title: 'Read now' },\n        { action: 'deals', title: 'See deals' }\n      ]\n    })\n  );\n});<\/code><\/pre>\n\n\n\n<p>Keep the URL absolute, for example https:\/\/example.com\/blog\/new-post\/. It&#8217;s also the place to add UTM parameters, so the visit shows up correctly in analytics. My post on <a href=\"https:\/\/larapush.com\/blog\/utm-parameters-on-web-push-links\/\">UTM parameters on web push links<\/a> explains the naming I use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_you_handle_the_notificationclick_event\"><\/span>How do you handle the notificationclick event?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Handle notificationclick by closing the notification, then focusing an existing tab with the same URL or opening a new one. Wrap the work in event.waitUntil() so the browser keeps the service worker alive until the tab opens.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>self.addEventListener('notificationclick', (event) =&gt; {\n  event.notification.close();\n\n  const base = event.notification.data?.url || '\/';\n  const target = event.action === 'deals' ? '\/deals\/' : base;\n  const url = new URL(target, self.location.origin).href;\n\n  event.waitUntil((async () =&gt; {\n    const tabs = await clients.matchAll({ type: 'window', includeUncontrolled: true });\n    for (const tab of tabs) {\n      if (tab.url === url &amp;&amp; 'focus' in tab) return tab.focus();\n    }\n    return clients.openWindow(url);\n  })());\n});<\/code><\/pre>\n\n\n\n<p>Three details matter here. First, clients.openWindow() only works inside the click event, because browsers allow new windows only after a user gesture. Second, includeUncontrolled: true finds tabs that your service worker doesn&#8217;t control yet. Third, comparing full URLs avoids focusing the homepage when the subscriber expected an article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Should_you_open_a_new_tab_or_focus_an_existing_one\"><\/span>Should you open a new tab or focus an existing one?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Focus an existing tab when the subscriber already has the exact page open, and open a new tab otherwise. That avoids duplicate tabs for the same page, which feels sloppy. For chat or dashboard apps, you may prefer to focus any open tab of your site and navigate it.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Click behaviour<\/th><th>Best for<\/th><th>Method<\/th><\/tr><\/thead><tbody><tr><td>Open a new tab<\/td><td>Blog posts, product pages, offers<\/td><td>clients.openWindow(url)<\/td><\/tr><tr><td>Focus the tab if that page is open<\/td><td>Any site; avoids duplicates<\/td><td>client.focus() after clients.matchAll()<\/td><\/tr><tr><td>Focus any site tab and change its page<\/td><td>Web apps, inboxes, dashboards<\/td><td>client.focus() then client.navigate(url)<\/td><\/tr><tr><td>Do nothing except close<\/td><td>Pure information alerts<\/td><td>event.notification.close() only<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Note that client.navigate() only works on tabs your service worker controls. If it fails, fall back to openWindow().<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_action_buttons_open_different_pages\"><\/span>How do action buttons open different pages?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Each action button has an action ID, and the click handler reads event.action to see which one was clicked. An empty value means the subscriber clicked the notification body. You then map each ID to its own URL, as in the code above.<\/p>\n\n\n\n<p>Chrome and Edge show up to two action buttons on most desktop systems; Notification.maxActions reports the limit at runtime. Safari and Firefox on desktop don&#8217;t show web push action buttons, so the notification body link must always work on its own. My post on <a href=\"https:\/\/larapush.com\/blog\/push-notification-cta-buttons\/\">push notification CTA buttons<\/a> covers button copy and support in more detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_does_clicking_a_web_push_notification_open_the_wrong_page\"><\/span>Why does clicking a web push notification open the wrong page?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Usually it&#8217;s because the URL never made it into data, the handler hard-codes a default, or openWindow() ran outside event.waitUntil(). Old service worker code can also linger after you deploy a fix.<\/p>\n\n\n\n<p>Check these in order:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log the payload in the push handler and confirm the URL is there.<\/li>\n\n\n\n<li>Confirm data.url is set in showNotification().<\/li>\n\n\n\n<li>Make sure the click handler reads event.notification.data, not a global variable.<\/li>\n\n\n\n<li>Wrap the tab logic in event.waitUntil().<\/li>\n\n\n\n<li>Update the service worker and test again; my guide to <a href=\"https:\/\/larapush.com\/blog\/debug-web-push-in-chrome-devtools\/\">debugging web push in Chrome DevTools<\/a> shows how to force the new version.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_LaraPush_fits\"><\/span>Where LaraPush fits<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you&#8217;d rather not write click handlers, a push panel does this for you. LaraPush is a self-hosted web push panel that you run on your own VPS, sold as a one-time licence from $499 (check <a href=\"https:\/\/larapush.com\/pricing\/\">LaraPush pricing<\/a>). Each campaign has a link field, plus up to two CTA buttons with separate click tracking, and Quick Push fetches the page metadata from a URL you paste. The <a href=\"https:\/\/larapush.com\/features\/\">features page<\/a> lists the rest. The trade-offs are no free plan and a server you maintain. For other tools, see my roundup of the <a href=\"https:\/\/larapush.com\/blog\/best-push-notification-services-and-tools\/\">best push notification services and tools<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1764148000000\"><strong class=\"schema-faq-question\">Why does nothing happen when I click my web push notification?<\/strong> <p class=\"schema-faq-answer\">Your service worker probably has no notificationclick handler, or the handler doesn&#8217;t call clients.openWindow(). Browsers don&#8217;t open a link automatically for classic web push. Add a click handler that closes the notification and opens the URL stored in its data field, wrapped in event.waitUntil().<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764148001111\"><strong class=\"schema-faq-question\">Can a web push notification open a URL on another domain?<\/strong> <p class=\"schema-faq-answer\">Yes. clients.openWindow() can open a cross-origin URL, such as an affiliate or partner page, as long as it runs inside the click event. However, you can&#8217;t focus or navigate tabs on another origin, so a new tab opens every time.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764148002222\"><strong class=\"schema-faq-question\">Can I open the page without a new tab?<\/strong> <p class=\"schema-faq-answer\">Yes, if a tab of your site is already open. Use clients.matchAll() to find it, call focus(), then navigate() to change its page. navigate() only works on tabs your service worker controls, so keep openWindow() as a fallback.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764148003333\"><strong class=\"schema-faq-question\">How do I track clicks on web push notifications?<\/strong> <p class=\"schema-faq-answer\">Add UTM parameters to the URL in the payload so analytics tools attribute the visit to push. For counts at the notification level, send a request to your own server from the notificationclick handler, or use a push panel that reports clicks per campaign and per button.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764148004444\"><strong class=\"schema-faq-question\">Do action buttons work on iPhone web push?<\/strong> <p class=\"schema-faq-answer\">Safari on iPhone and iPad doesn&#8217;t show web push action buttons, so only the notification body is clickable. Always make the main notification link lead somewhere useful. On Chrome and Edge for desktop and Android, up to two buttons are typically available.<\/p> <\/div><\/div>\n","protected":false},"excerpt":{"rendered":"Set the web push click URL with the data field and a notificationclick handler. Code to focus or open tabs and route action buttons.","protected":false},"author":7,"featured_media":3580,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":""},"categories":[68],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Open a Specific Page When Someone Clicks a Web Push Notification<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Open a Specific Page When Someone Clicks a Web Push Notification\" \/>\n<meta property=\"og:description\" content=\"Set the web push click URL with the data field and a notificationclick handler. Code to focus or open tabs and route action buttons.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\" \/>\n<meta property=\"og:site_name\" content=\"LaraPush Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-26T04:41:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ritesh Das\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ritesh Das\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\"},\"author\":{\"name\":\"Ritesh Das\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\"},\"headline\":\"How to Open a Specific Page When Someone Clicks a Web Push Notification\",\"datePublished\":\"2026-11-26T04:41:14+00:00\",\"dateModified\":\"2026-11-26T04:41:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\"},\"wordCount\":1285,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg\",\"articleSection\":[\"How to\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\",\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\",\"name\":\"How to Open a Specific Page When Someone Clicks a Web Push Notification\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg\",\"datePublished\":\"2026-11-26T04:41:14+00:00\",\"dateModified\":\"2026-11-26T04:41:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000\"},{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111\"},{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222\"},{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333\"},{\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Illustration of a web push click URL, a cursor clicking a notification that opens a specific web page\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/larapush.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Open a Specific Page When Someone Clicks a Web Push Notification\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/larapush.com\/blog\/#website\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"name\":\"LaraPush Blog\",\"description\":\"Stay Ahead, Stay Notified with LaraPush!\",\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/larapush.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/larapush.com\/blog\/#organization\",\"name\":\"LaraPush\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"width\":280,\"height\":60,\"caption\":\"LaraPush\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\",\"name\":\"Ritesh Das\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"caption\":\"Ritesh Das\"},\"url\":\"https:\/\/larapush.com\/blog\/author\/riteshdas\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000\",\"position\":1,\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000\",\"name\":\"Why does nothing happen when I click my web push notification?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Your service worker probably has no notificationclick handler, or the handler doesn't call clients.openWindow(). Browsers don't open a link automatically for classic web push. Add a click handler that closes the notification and opens the URL stored in its data field, wrapped in event.waitUntil().\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111\",\"position\":2,\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111\",\"name\":\"Can a web push notification open a URL on another domain?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. clients.openWindow() can open a cross-origin URL, such as an affiliate or partner page, as long as it runs inside the click event. However, you can't focus or navigate tabs on another origin, so a new tab opens every time.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222\",\"position\":3,\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222\",\"name\":\"Can I open the page without a new tab?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, if a tab of your site is already open. Use clients.matchAll() to find it, call focus(), then navigate() to change its page. navigate() only works on tabs your service worker controls, so keep openWindow() as a fallback.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333\",\"position\":4,\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333\",\"name\":\"How do I track clicks on web push notifications?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Add UTM parameters to the URL in the payload so analytics tools attribute the visit to push. For counts at the notification level, send a request to your own server from the notificationclick handler, or use a push panel that reports clicks per campaign and per button.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444\",\"position\":5,\"url\":\"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444\",\"name\":\"Do action buttons work on iPhone web push?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Safari on iPhone and iPad doesn't show web push action buttons, so only the notification body is clickable. Always make the main notification link lead somewhere useful. On Chrome and Edge for desktop and Android, up to two buttons are typically available.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Open a Specific Page When Someone Clicks a Web Push Notification","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/","og_locale":"en_US","og_type":"article","og_title":"How to Open a Specific Page When Someone Clicks a Web Push Notification","og_description":"Set the web push click URL with the data field and a notificationclick handler. Code to focus or open tabs and route action buttons.","og_url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/","og_site_name":"LaraPush Blog","article_published_time":"2026-11-26T04:41:14+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg","type":"image\/jpeg"}],"author":"Ritesh Das","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ritesh Das","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#article","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/"},"author":{"name":"Ritesh Das","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd"},"headline":"How to Open a Specific Page When Someone Clicks a Web Push Notification","datePublished":"2026-11-26T04:41:14+00:00","dateModified":"2026-11-26T04:41:14+00:00","mainEntityOfPage":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/"},"wordCount":1285,"commentCount":0,"publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"image":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg","articleSection":["How to"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/","url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/","name":"How to Open a Specific Page When Someone Clicks a Web Push Notification","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage"},"image":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg","datePublished":"2026-11-26T04:41:14+00:00","dateModified":"2026-11-26T04:41:14+00:00","breadcrumb":{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000"},{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111"},{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222"},{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333"},{"@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#primaryimage","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/open-url-on-web-push-click.jpg","width":1200,"height":675,"caption":"Illustration of a web push click URL, a cursor clicking a notification that opens a specific web page"},{"@type":"BreadcrumbList","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/larapush.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Open a Specific Page When Someone Clicks a Web Push Notification"}]},{"@type":"WebSite","@id":"https:\/\/larapush.com\/blog\/#website","url":"https:\/\/larapush.com\/blog\/","name":"LaraPush Blog","description":"Stay Ahead, Stay Notified with LaraPush!","publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/larapush.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/larapush.com\/blog\/#organization","name":"LaraPush","url":"https:\/\/larapush.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","width":280,"height":60,"caption":"LaraPush"},"image":{"@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd","name":"Ritesh Das","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","caption":"Ritesh Das"},"url":"https:\/\/larapush.com\/blog\/author\/riteshdas\/"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000","position":1,"url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148000000","name":"Why does nothing happen when I click my web push notification?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Your service worker probably has no notificationclick handler, or the handler doesn't call clients.openWindow(). Browsers don't open a link automatically for classic web push. Add a click handler that closes the notification and opens the URL stored in its data field, wrapped in event.waitUntil().","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111","position":2,"url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148001111","name":"Can a web push notification open a URL on another domain?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes. clients.openWindow() can open a cross-origin URL, such as an affiliate or partner page, as long as it runs inside the click event. However, you can't focus or navigate tabs on another origin, so a new tab opens every time.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222","position":3,"url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148002222","name":"Can I open the page without a new tab?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, if a tab of your site is already open. Use clients.matchAll() to find it, call focus(), then navigate() to change its page. navigate() only works on tabs your service worker controls, so keep openWindow() as a fallback.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333","position":4,"url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148003333","name":"How do I track clicks on web push notifications?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Add UTM parameters to the URL in the payload so analytics tools attribute the visit to push. For counts at the notification level, send a request to your own server from the notificationclick handler, or use a push panel that reports clicks per campaign and per button.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444","position":5,"url":"https:\/\/larapush.com\/blog\/open-url-on-web-push-click\/#faq-question-1764148004444","name":"Do action buttons work on iPhone web push?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Safari on iPhone and iPad doesn't show web push action buttons, so only the notification body is clickable. Always make the main notification link lead somewhere useful. On Chrome and Edge for desktop and Android, up to two buttons are typically available.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3573"}],"collection":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/comments?post=3573"}],"version-history":[{"count":1,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3573\/revisions"}],"predecessor-version":[{"id":3581,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3573\/revisions\/3581"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media\/3580"}],"wp:attachment":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media?parent=3573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/categories?post=3573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/tags?post=3573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}