Web push notifications are sent to website visitors who have accepted on your website to receive notifications. No information is requested to visitors who subscribe, other than their subscription; so they are all anonymous at first. 

However, to be able to send personalized notifications (for instance: Hello Suzan! See what's new in our platform!), you need to be able to identify subscribers and see if some are contacts in your list of contacts in Dialog Insight.

There are two ways to map subscribers to contacts in your project: 

  • By sending an email (using injection rules)
    When configuring a website, an injection rule (Dialog Insight tracking) is automatically added in email communications on links containing the domain name specified in the configuration of web push notifications. Contacts who click a link that redirects them to your website will then be associated to a subscription if they decide to allow notifications, or if they already have.

  • By coding
    In the script of web push notifications, there is a Javascript function that is available to let you identify subscribers, if you already have data on them. For example, if your website allows visitors to connect to it, then you already have some information on them like their email, first name and last name. You can then use this information to call the Javascript function, with the proper parameters, to associate the subscription to a contact, if this contact exists in the Dialog Insight platform.

Function
DI.WebPush.Identify("f_FieldCode", "Value");

Parameters
"f_FieldCode": code of the field "primary key". You can find this information in the article about configuring fields in your project.
"Value": value to search for in contact profiles in your project.


Example when the email is the primary key
DI.WebPush.Identify("f_EMail", "email@domain.com");
*f_EMail is just an example; check what the right code is in the configuration of your project fields.

Example when the client number is the primary key
DI.WebPush.Identify("f_NoClient", "123456789");
*f_NoClient is just an example; check what the right code is in the configuration of your project fields.

Example with two primary keys
DI.WebPush.Identify("f_EMail", "email@domain.com", "f_NoClient", "123456789");
*f_EMail and f_NoClient is just an example; check what the right code is in the configuration of your project fields.