Implementation Steps

Step-by-step instructions on how to add Pushly to your website.

Requirements

Support for web push notifications requires:

  • Your website to be SSL-enabled (https://)

  • One publicly-accessible file to be placed at the public root of your site

  • A snippet of Integration HTML to be added to each page on your site.

    • This can also be done with a tag manager.

Place the Service Worker

Web Push support requires a Service Worker to be publicly accessible from your domain. Ideally this file serves from the public root of your domain. For example, when placed, the file should be accessible from your domain like this: https://www.alloceannews.com/pushly-sdk-worker.js.

Download the Service Worker here: https://cdn.p-n.io/pushly-sdk-worker.js‚Äč

If you have an existing Service Worker or need to serve the Service Worker from another location please see the Integration FAQ for more information.

Add the Integration HTML

Next, add the Integration HTML to the head section of your site and replace both instances of DOMAIN_KEY with the value provided by your account manager.

<script src="https://cdn.p-n.io/pushly-sdk.min.js?domain_key=DOMAIN_KEY" async></script>
<script>
var PushlySDK = window.PushlySDK || [];
function pushly() { PushlySDK.push(arguments) }
pushly('load', {
domainKey: 'DOMAIN_KEY',
});
</script>

Ensure that you replace DOMAIN_KEY within the integration HTML with the value provided by your Pushly account manager.