Installing the script on the site
To start using the web-push notifications functionality, you need to follow the steps below:
1. Install our script on each page of the site:
<script type="text/javascript"> var script = document.createElement('script'); script.type = 'text/javascript'; script.src = '//cdn.enkod.ru/script/enpop.min.js'; script.async = true; var first = document.getElementsByTagName('script')[0]; first.parentNode.insertBefore(script, first); var enKodBox = window.enKodBox = window.enKodBox || {}; var ekEvents = window.ekEvents || []; enKodBox['token'] = 'SYSTEM_NAME'; </script>
2. Put the file from the archive into the root of the site firebase-messaging-sw.zip
3. Notify your manager that everything is ready
Creating and sending web-push notifications
The first step in creating a message is to select a communication channel
Sending type
You can send the push instantly or schedule it to be sent on the desired day and time. In addition, an automatic regular sending option is available (you can set the start date and end date of sending, as well as the required hour/day/week/month).
- Instant - will be sent immediately after the settings are made
- Scheduled - the date and time of sending is set manually during the creation process.
- Regular - manually set the start and end date of sending, as well as the regularity: every hour (every hour in the selected time interval), every day (every day at the selected time), every week (selected days of the week in the selected interval), by month (either by selected days of the week or by selected dates monthly).
Message editor
In this step, you need to specify the post subject, content, a link to an image if one will be used, and a link to go to. A preview of the push will be displayed in the window on the left. UTM tags and URL parameters work the same way as in email messages. Here you can also attach tags to the push.
You can choose to preview the push on both desktop and mobile versions. Here you can also set the lifetime of the push in seconds.
Recipients
After creating the push, you need to specify the recipients of the message. You can select the segment(s) from the list by clicking on the “+” to the right of the name.
At each step, you can go back to previous steps by clicking on the “Back” button or on the title of any step ticked. You can also save a message as a draft. It will then appear in the list of messages, where you can copy, edit or delete it.
Summary report (summary)
The last step is to view the details of the message: the preview of the push, the content data, the send and the recipients. Once you check them and click “Send”, the message will be created and sent if the send condition is set to “now”.
Push life time
Web Pushes have a “lifetime” in seconds, which can be set in the creation wizard. The push is sent to all contacts from the selected segments at once. The number of sends is recorded in the statistics. Lifetime - the maximum allowable (based on the relevance of the content) time, which is set to wait until the recipient enters the browser and can see the notification. If the push has not been shown during this time (the user still hasn't opened the browser), the attempts to show the push will be stopped. After the push is shown, the opening is recorded in the statistics.
Information about Web Push recipients
In Web Push segments, recipients are counted by the number of unique contacts, however, one contact can have more than one device assigned to it. As a result, the number of messages sent (displayed in Message Details ➔ Device Statistics) may be higher than expected. In the Message Details ➔ Information ➔ Recipients section, you can track the number of recipients, sent and unsent messages separately by unique contacts and separately by number of devices.