How to Install a Web Push Script
Here you will learn about how to install web push on your web to integrate with MTARGET. It is important to know, the steps written here may be different from those on your website system. However, this tutorial has been made as general as possible, so if there are differences when installing the code on the website system, we recommend contacting your engineering team to help install the web-push code.
Here are the steps for a Web-Push installation:
- Enter the ‘Push Campaign’ menu.
- Click the ‘Settings’ button.
- In the first, you will be installing the HTML code into your web editor. Copy the code, then paste HTML code to header after < head > tag (No spaces).
- Create a file manually with the name mtt-sw.js, then copy the js code and paste to your file mtt-sw.js.
- If the first method fails to load, download the serviceworker.js here file, then save.
Put this .js file in the root or public directory on your website.
If all the steps above have been fulfilled, you should have successfully installed the web-push script on your website. To check it, you can do a hard reload (CTRL + F5) on your website. If an opt-in notification appears to block or allow, the script has been successfully installed.