Troubleshooting Website

Common issues with website push notifications.

Supported Browsers

Browser

Windows PC

macOS

Android

iOS

Google Chrome

YES

YES

YES

N/A

Firefox (non-ESR)

YES

YES

YES

N/A

Safari

N/A

NO

N/A

N/A

Microsoft Edge

YES

N/A

YES

N/A

Opera

YES

YES

YES

N/A

Internet Explorer

N/A

N/A

N/A

N/A

Legend:
N/A Push notifications are technically Not Available in this configuration.
NO We do not support push notifications in this configuration.

Testing as a new user

👍

Clearing Browsing Data under Google Chrome

We recommend you create a dedicated profile to test web push in Google Chrome. A new profile can be created by clicking the person icon (👤) left of the the ⋮ menu button, and choosing Manage people, then clicking the Add person button on the opened window.

With this new profile, you should clear browsing data every time you want to test subscribing to push notifications:

  1. Under Chrome, choose Clear Browsing Data...
  2. Select Advanced
  3. Select All time in the Time range dropdown
  4. Check Cookies and other site data as well as Content settings

Web push is not working at all

  1. Make sure you are using a supported browser;
  2. Make sure you are not browsing in Private mode, Incognito mode or Guest browsing mode.
  3. If you see an error like GET https://cdn.by.wonderpush.com/sdk/1.1/wonderpush-loader.min.js net::ERR_BLOCKED_BY_CLIENT, you have a browser extension like an ad blocker that is preventing the SDK to load. Either disable it or add an exception to whitelist all wonderpush.com domains.
  4. Make sure your browser's notifications are not disabled in your system.
  5. If your device is connected to the Internet via an enterprise network, chances are you are behind a Firewall. Firebase Cloud Messaging, the technology behind Chrome push notifications, requires ports 5228, 5229 and 5230 to be open for notifications to be delivered.
  6. Make sure you are not in Do not disturb mode in your OS.
  7. Please close any already displayed notification, as in some cases only a few are shown at a time, and the rest appears once room is made.
  8. Do not use fullscreen, otherwise notifications will wait until you exit fullscreen.

The changes I made from the dashboard are not applied immediately

There are 2 levels of cache implied in the configuration you manage via the dashboard:

  • Server-side edge cache: It is used to ensure prompt delivery of the configuration to each client. It's duration is 1 hour.
  • Client-side cache: It is used to reduce the number of requests done by the client to reduce battery and data consumption. It's duration is 12 hours.

This means that a change you did in the dashboard will be seen for new visitors in 1 hour maximum, and will be seen for previous visitors in 12 hours maximum.
If you wish to validate a configuration change, wait 1 hour max and either test as a new user or invalidate the client-side cache using the following code:

WonderPush.Developer.invalidateConfig()

It is possible that you need to execute this command in the context of the wonderpush.min.html frame in addition to the top context. Change the context as show below, and run the command again:

I cannot put the async script tag on my site

If you are restricted to writing JavaScript and cannot add the first script tag, simply use the following alternative snippet:

(function(){
  var js = document.createElement('script');
  js.src = 'https://cdn.by.wonderpush.com/sdk/1.1/wonderpush-loader.min.js';
  js.async = true;
  document.head.appendNode(js);
})();

window.WonderPush = window.WonderPush || [];
WonderPush.push(["init", {
    webKey: "YOUR_WEBKEY",
}]);

Replace YOUR_WEBKEY with the webkey of the snippet from your dashboard.

The subscription dialog is not showing

  1. Double-check the subscription dialog settings in your dashboard. Please allow 12 hours for any change to be taken into account.
  2. Clear browsing data as indicated above and try again.
  3. Open the console in your browser and check for any error messages related to WonderPush.
  4. Make sure the WonderPush SDK is correctly installed by pasting this script in the console:
WonderPush.push(function() { console.log('WonderPush is installed'); });

Press Enter, the console should display "WonderPush is installed". If you do not see this message, double check our Website Quickstart.

  1. Double-check the subscription dialog init options of your integration.

Notifications are not received in Google Chrome

🚧

Make sure you don't have many notifications already displayed, depending on the browser and OS, new notifications will only be displayed once older ones are closed.

  1. Check that you are subscribed to notifications by pasting the following script in your console:
WonderPush.push(function() { WonderPush.isSubscribedToNotifications().then(function(isSubscribed) { console.log('Subscribed', isSubscribed); }); });

Press Enter. The console should display: Subscribed: true.
If not, then paste the following to subscribe:

WonderPush.push(function() { WonderPush.subscribeToNotifications(); });
  1. Go to chrome://gcm-internals/ and check that you see GCM Client State: READY and Connection State: CONNECTED, then send yourself a notification, and verify it is received in the Receive Message Log. If the log stays empty, the notification was not delivered.
    If not, then contact your network administrator.
  2. Clear website data as described at the top of this document, subscribe again and send yourself a push notification.

ReferenceError: WonderPush is not defined

This means that WonderPush has not been included in your page, either prior to the first place you use it, or at all.

Be sure to include WonderPush in all your pages to properly track user engagement.

If you happen to use WonderPush in multiple places and cannot make sure that the SDK installation snippet is present prior to one of the places you use it, simply add this simple line at the top or your script:

WonderPush = window.WonderPush || [];

WonderPush.push is not a function

See the upgrade guide.

You will need to update your integration script.

Replace this older snippet:

<script>
(function(w,d,s,i,n){w[n]=w[n]||{q:[],init:function(o){w[n].initOpts=o;},ready:function(c){w[n].q.push(c);}};
setTimeout(function(j,k){if(!d.getElementById(i)){k=d.getElementsByTagName(s)[0];j=d.createElement(s);j.id=i;
j.src="wonderpush-loader.js";k.parentNode.insertBefore(j,k);}},0);
}(window,document,"script","wonderpush-jssdk-loader","WonderPush"));

WonderPush.init({
    webKey: "YOUR_WEBKEY",
    // any other options…
});
</script>

With this new one, as you can find in your dashboard:

<script src="https://cdn.by.wonderpush.com/sdk/1.1/wonderpush-loader.min.js" async></script>
<script>
WonderPush = window.WonderPush || [];
WonderPush.push(["init", {
    webKey: "YOUR_WEBKEY",
    // any other options…
}]);
</script>

You will also need to update calls from WonderPush.ready to WonderPush.push, see next section.

This site has been updated in the background

When receiving web push notifications, instead of the intended message the following is displayed: This site has been updated in the background.

It's likely that your site has more than one service worker on the same scope. Please follow the steps described in Service Worker Integration.

WonderPush.ready is not a function

See the upgrade guide.

Update calls from WonderPush.ready to WonderPush.push, you're done.

To ease migration you can also add the following line, after the first line shown as context:

WonderPush = window.WonderPush || [];
WonderPush.ready = WonderPush.push;

Why can't I see my subscription prompt for Web Push notifications on iOS?

Unfortunately, iOS does not yet support web push. So, only an application can implement push on iOS devices, but not a website.
Read more:
When will iOS implement web push notifications?
Sign the petition on change.org

WordPress CDN & Cache Plugin Support

Using cache plug-ins with CDN support can prevent the required files from being served by your domains. Here's how to use the appropriate settings:

Autoptimize

In Excluded scripts section, exclude the WonderPush Script:
wp-content/plugins/wonderpush-web-push-notifications/assets/sdk/(.*)

WP Rocket

In the WP Rocket CDN settings, under "Exclude Files From CDN" add:
(.*)/wonderpush-web-push-notifications/assets/sdk/(.*)

LightSpeed

In the LightSpeed CDN settings, under "Exclude Path" add:
(.*)/wonderpush-web-push-notifications/assets/sdk/(.*)

WP Super Cache

In the CDN tab, make sure the Exclude if substring tab has at least these two entries:
.php, wonderpush-web-push-notifications
After changing, don't forget to click the Delete Cache button.

W3 Total Cache

In the CDN tab (after clicking Performance on the left sidebar), make sure the "Rejected files" text box has at least the following entry:
{plugins_dir}/wonderpush-web-push-notifications/assets/sdk/*
After changing, don't forget to click Save all setting.

WP Engine

In your WP Engine plugin > General Settings > HTML Post-Processing
add the below URLs replacing "YOURSITEHERE" with your website:
#https?://(www\.)?(YOURSITEHERE\.com|mywpenginehandleHere.wpengine.com|wpengineCDNpathHere.wpengine.netdna-(ssl|cdn).com)/wp-(content|includes)# => https://wpengineCDNpathHere-wpengine.netdna-ssl.com/wp-$4 #https://wpengineCDNpathHere-wpengine.netdna-ssl.com/plugins/wonderpush-web-push-notifications/# => https://mywebsiteHere.com/wp-content/plugins/wonderpush-web-push-notifications/ #https://wpengineCDNpathHere-wpengine.netdna-ssl.com/wp-content/plugins/wonderpush-web-push-notifications/# => https://mywebsiteHere.com/wp-content/plugins/wonderpush-web-push-notifications/