To be able to send web push notifications from the Dialog Insight application, you must first identify and configure the website for which you want to display notifications.

Configuring web push notifications in Dialog Insight requires  the help of a technical person who is responsible for the website* for which to display notifications. Depending on the company, this person can be a web developer, a web integrator, a webmaster or any other person with a similar role.

Prerequisite
Dialog Insight's web push module
A website and a Google account
Access Path
> Configuration > Push notifications

Configuration of your website

  1. In the Push notifications page, click Add your website.
  2. On the Web configuration page:
    1. Change the name of the website by clicking the edit icon.
      This name is only used internally in the Dialog Insight platform.
    2. Enter the domain name of your website.
      This domaine must be secured (https).
    3. Add the languages available on your website and in which you plan on sending notifications. It is important to check them after adding them so that they are available when creating notifications.
  3. In the Presentation section:
    1. Add the default icon to use in your notifications.
      This image should represent your company and easily recognizable by your visitors. You can change it if needed at the time of creation.
  4. In the Firebase Cloud Messaging section:
    *This section requires the help of a web developer or integrator.
    1. Specify the Sender ID and the Server key.
      Why and how to get this information?
    2. Click Save.

Installation on your webiste

*This section requires the help of a web developer or integrator.

  1. In the Code and file section:
    1. Copy-paste the entire code (script) displayed in this section on ALL the website pages where you want to offer subscription to web pushes, inside the <head></head> tags, or just before the </body> tag.
    2. Click the Download the file button, and copy-paste this file at the root of your website.


Your site is on Wordpress? 
Install this Wordpress plugin to insert the code on your website pages.


Integration of the subscription request

*This section requires the help of a web developer or integrator.

In the provided script your copied, there is a Javascript function to trigger the authorization request in your browser. 

  1. Integrate the subscription request on your website on a clickable element such as a button, an image, a link, etc.
    We recommend that you let the visitor perform the action of requesting, instead of displaying the request automatically upon visit.
  2. La fonction est la suivante :
    Function: DI.WebPush.RequestPermission('language code');
    The the language code must be the 2 character code corresponding to the subscription language. This code is shown next to each language you have selected in the Configuration section above.
  • Example on a text link:
    <a href="#" onclick="DI.WebPush.RequestPermission('en');">I wish to receive notifications</a>
  • Example on an image:
    <img src="image.jpg" onclick="DI.WebPush.RequestPermission('en');" alt="I wish to receive notifications" />

Testing

Although this step is not mandatory, we strongly recommend to perform it as it allows you to test the display of web push notifications on your website, but not on your own pages. The demo page is used to perform a test without affecting your own website's pages.