Skip to content

User Denied Permission to Use the Push API

If you open your browser's developer console on a page running the Aimtell tracking code, you may see a message like this:

text
[aimtell] - Unable to subscribe to push. DOMException [NotAllowedError: "User denied permission to use the Push API."]

What it means

This is a message from the browser, not an error in your Aimtell setup. It means the browser refused the request to subscribe that visitor to push notifications, because push permission was not granted.

Browsers only allow a site to subscribe someone to push after that person explicitly allows it. When permission is anything other than "granted", the subscription attempt is rejected and the browser reports it as a NotAllowedError. Aimtell logs that rejection to the console so it is visible while troubleshooting.

What causes it

  • The visitor clicked "Block" (or "Don't allow") on the browser's permission prompt.
  • The visitor dismissed the prompt by clicking the "X" instead of answering it.
  • The visitor had already blocked notifications for your site at some point in the past. Browsers remember that choice, so no prompt is shown on later visits and every subscription attempt is refused until the visitor resets the permission themselves.
  • On Firefox 52 and older, the prompt is dismissed automatically if the visitor clicks anywhere on the page before answering it, which produces this same message.

Do you need to fix it?

Usually not. Some percentage of visitors will always decline, and this message is the normal, expected result when they do. Seeing it in your console is not a sign that your tracking code or service worker is installed incorrectly.

It is worth a closer look in two cases:

  • You see it on your own machine and never denied the prompt. You most likely blocked notifications for the site earlier. Reset the site's notification permission in your browser settings and reload the page.
  • No one is able to subscribe at all. If your opt-in rate is zero rather than merely low, the cause is more likely an installation problem than visitor denials. Check your tracking code and worker file setup.

To measure how often visitors accept versus decline, see Opt-in Percentage Explained. If you want to run your own javascript when someone approves or denies the prompt, see Triggering Javascript After Prompt Approval/Denial.