Search…
Implementation Steps
Step-by-step instructions on how to add Pushly to your website.

Support for web push notifications requires:
  • Your website to be SSL-enabled (https://)
  • One publicly-accessible file to be placed on 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.

If your site uses Wordpress you can skip these steps and follow the Wordpress Plugin steps for an easier implementation.

Download the Service Worker from our CDN (https://cdn.p-n.io/pushly-sdk-worker.js) and place it in a publicly accessible location on your domain. For example: https://www.example.com/assets/pushly/pushly-sdk-worker.js
Ensure this file is served with a application/javascript content type header.

If you placed the Service Worker in a subdirectory on your domain follow the steps in the Service Worker Placed in Subdirectory tab otherwise select the Service Worker Placed in Public Root tab below.
Service Worker Placed in Subdirectory
Service Worker Placed in Public Root
Add the following HTML snippet to the head section of your site and replace both instances of DOMAIN_KEY with the value provided by your account manager.
Also, replace the /absolute/path/to/pushly-sdk-worker.js text in the snippet with the full path to the Service Worker.
<script src="https://cdn.p-n.io/pushly-sdk.min.js?domain_key=DOMAIN_KEY" async></script>
<script>
window.PushlySDK = window.PushlySDK || [];
function pushly() { window.PushlySDK.push(arguments) }
pushly('load', {
domainKey: 'DOMAIN_KEY',
sw: '/absolute/path/to/pushly-sdk-worker.js',
});
</script>
Add the following HTML snippet 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>
window.PushlySDK = window.PushlySDK || [];
function pushly() { window.PushlySDK.push(arguments) }
pushly('load', {
domainKey: 'DOMAIN_KEY',
});
</script>
Copy link
On this page
Requirements
Steps
Step 1: Place the Service Worker File
Step 2: Add the Integration HTML