Push notification is a very special ad format, and there's a reason why it has become extremely popular in the last few years. We link it to the fact that it looks less intrusive than many other popular ad formats and is rather new. Therefore, advertisers get a high conversion rate with this ad format across different categories. It's a pleasure to announce that we support this ad format, and here we will explain how push notifications work. So we hope this article helps you decide whether it fits your needs and purposes.

How to set up push notifications

Push notifications are not like most ad formats by their design. An ad server, not users, initiates them. Thus, a visitor's action is only required in the very beginning when they agree to a subscription request. After that, the ad server starts delivering ads periodically (every 3 hours by default; we can change the timing upon request).

Just like with other ad formats, targeting, capping, etc, works with Push Notifications.

Please note that your website visitors may consider too many Push Notifications aggressive and intrusive. Make sure you don't annoy them with frequent and boring ads. Otherwise, it may result in canceled subscriptions.

Therefore, setting frequency capping for the push zone in its Advanced options is vital.

If capping is not configured, the system applies a default value of 1 impression per 12 hours.

Additional limitations of push notifications:

  • websites require an HTTPS certificate in order to start using this ad format
  • it doesn't work with Safari browser due to technical limitations

Demo here https://adserver.online/demo/push

1. Subscriptions tab in the Reports menu.

A new subscription appears on a list every time a website visitor clicks the 'Allow' button on a subscription request in a browser.

2. Zone format on a zone form – Push notification

The ad code contains two parts, so we urge you to read the description on the zone view page carefully.

3. Ad format on a 'Create ads' form (Step #1) – Notifications / Push

Code configuration

Ensure you have installed the latest version of the code from your panel.

Options

  • timeout – a timeout in seconds before the browser will ask for a subscription after a visitor opens your webpage
  • autoRun – defines whether a subscription is triggered automatically on page load. Enabled by default
  • bindTo – binds subscription trigger to some specific tag names or classes. The value is an array of strings. If defined, autoRun is disabled automatically.
  • ignoreTo – acts similarly to bindTo. It is used to restrict the subscription to trigger when users click on ignored elements/ DOM nodes. The value is an array of strings. When defined, autoRun is disabled automatically.
  • loadsBeforeFire – sets the number of pages the user should open before the browser asks for a subscription. This option has a higher priority than bindTo and ignoreTo.
  • attr – you can pass arbitrary data using this parameter. The system will save it along with subscription. The data will be available for custom targeting and tracking.

Callbacks

  • onCanSubscribe – called once when code loaded. Please note the code loads only if a visitor is not subscribed yet (and not blocked subscription) and the browser supports push notifications.
  • onSubscribe – called when the browser's subscription has to be triggered.

Public API

The code provides one method that can be used in either callbacks or in your application code.

The method triggers browser subscription popup.

_ASO.Push.subscribe();

Events

The code sends out different events. You may subscribe to them as follow:

$(document).on('_push_subscription', function (e) {
    console.log(e.detail);
});

Configuration example

<script data-cfasync="false">
(function(w,a){
  w[a] = w[a] || {};
  w[a].queue = w[a].queue || [];
  w[a].queue.push(function () { 
   _ASO.PushOptions = { 
     idzone:XXXXXX,
     loadsBeforeFire: 2,
     ignoreTo: ['.ignoreMe'],
     bindTo: ['.playButton'],
     timeout: 5,
     attr: {
       refid: 'abc',
       refid1: 'xxx',
       tags: ['apple', 'banana']
     }  
   }; 
  _ASO.loadPushHelper();
  })
})(window, "_aso");
</script>

Advanced demo here https://adserver.online/demo/push-adv

Troubleshooting

The push notifications subscription pop-up doesn't show up in Chrome / Firefox / Edge / Opera

Solutions:

  • In order to use Push Notifications, your website must use an HTTPS protocol
  • Ensure that you haven't blocked notifications. Click on the lock next to the address bar and ensure that you have Notifications: ask (or Notifications: allow)
  • Open the console from the browser developer tools and make sure there are no errors
  • Disable any ad blockers that may be blocking requests to an ad server
  • Make sure that the service worker is served from the root of your website (e.g. https://example.com/aso-worker.js), otherwise, it may not become active on some pages causing the starvation of method calls

The push notifications subscription pop-up doesn't show up in Safari

Adserver.Online doesn't support push notifications in Safari browser at the moment.

The push notifications subscription pop-up doesn't show up on iPhone / iPad

iOS and iPadOS don't support Web Push notification standards.

You get a Javascript error about the applicationServerKey

Symptoms:

  • You cannot subscribe to the notifications, even when you have granted permission.
  • When you try to subscribe the user to push notifications, you can see this message in the browser developer console: DOMException: Registration failed - A subscription with a different applicationServerKey (or gcm_sender_id) already exists; to change the applicationServerKey, unsubscribe then resubscribe.

Solutions:

  • You're getting this exception because you are using ad code from several ad networks on the same domain. It is bad practice, so make sure you don't make this mistake.
  • Make sure that you are using only one Adserver.Online ad code on your domain.
  • In any case, you can easily fix this exception by resetting the browser subscription. Go to browser preferences (or click the green lock near the address bar) and block the notifications for your domain. Then allow notifications again and refresh the page.

Why are some web push notifications not delivered to the browser/device despite the fact that they were sent out by an ad server?

Please note the ad server sends a notification to the browser's push service provided by Google, Mozilla, and Microsoft, but not to the end-user browser/device directly. Therefore, 3rd-party services are responsible for delivering a notification to the end-user browser/device.

The notification may not reach the end-user for various reasons:

  • the recipient device is turned off
  • the recipient device has no internet connection
  • the browser is closed (some browsers, mainly desktop ones, need to be open in order to receive push notifications)
  • the recipient device has airplane mode enabled
  • the recipient device has a power-saving mode enabled
  • the browser process responsible for downloading push notifications runs in the background and may be killed for power saving; this happens mainly on mobile devices
  • the browser does not have the right permissions to download data from the internet when the screen is locked (the notification may be lost in this case)
  • the user has unsubscribed via browser preferences, but the browser push service wasn’t notified about that and considered the subscription valid
  • the user doesn’t use a given browser or device anymore (the browser push service should remove that subscription after several months of inactivity)
  • the browser receives the signal, but the internet connection is lost when it tries to download the notifications

This concludes our article about push notifications, their characteristic features, and their limitations. Undoubtedly, it is an interesting ad format that can be extremely profitable for publishers and advertisers.