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 it's rather new. Therefore advertisers manage to 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 to decide whether it fits your needs and purposes or not.

How to set up push notifications

Push notifications are not like most ad formats by their design. They are initiated by an ad server, not users. 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 works with Push Notifications. In this case, targeting works at the moment when a visitor subscribes to receive 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 cancelled subscriptions.

Therefore, it is vital to set frequency capping for push zone in its Advanced options:

push notifications - adserver.online

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:

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

3. Ad format on a 'Create ads' form (Step #1):

Code configuration

Make sure 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 subscription 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 similar 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 an amount of pages that 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 some web push notifications are not delivered to the browser/device despite 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 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 considers 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 limitations. No doubt, it is an interesting ad format that can be extremely profitable for both publishers and advertisers. Provided that everyone uses it, not abuses.