These instructions are aimed at websites with HTTPS encryption.
Requirements – if not already done:
- Create a user account at cleverpush.com/register
- After logging in, create a channel with the type “Website”
Implementation
- Please navigate to Channels -> (select channel) in your CleverPush back office.
- There you will find the operation mode setting. Set this option to Own Domain (HTTPS).
- The cleverpush-worker.js file can then be downloaded by clicking the button.
- This file must now be placed in the main directory of your web server. So it should be available at https://your-domain.com/cleverpush-worker.js.Note: If you do not have the option of placing the file in the main directory of your website, you can define your own file paths under the operating mode setting.
- Now only the CleverPush Javascript snippet has to be integrated. The code for this is available in the channel settings in the sidebar under “Implementation”.This can be done in the <head> or in the <body> area of the page.
Google Tag Manager is also possible (with occasional ad blockers blocking the entire GTM code).- In the Google Tag Manager, our Javascript code can easily be inserted as a “user-defined HTML tag”.
- In the Google Tag Manager, our Javascript code can easily be inserted as a “user-defined HTML tag”.
Troubleshooting – opt-in does not work:
- Can the worker file be reached with the correct MIME type?
- cleverpush-worker.js (application/javascript)
- Are you installing your own ServiceWorker yourself in parallel? There are 2 options:
- Integrate the line of code from cleverpush-worker.js in your ServiceWorker and adapt the file path accordingly to your ServiceWorker
- Install the CleverPush Worker in a different subdirectory
- When using your own file paths:
- Paths should usually begin with a slash and do not contain any domains or protocols
- Paths are absolute and not relative
If you have any further problems, please contact our support.