Our documentation is changing, please click here to enjoy it!

Skip to end of metadata
Go to start of metadata

3.1 Overview

You can collect opt-in users from any website, any domain or subdomain (such as yourwebsite.comyourwebsite.de, or shop.yourwebsite.com…), whether http or https, and have a unified database for your Web Push Notification messages.


In order to send Web Push Notifications to your website users, you first need to obtain their permission (‘opt-in’). We call the whole procedure to obtain user permission, the ‘opt-in process’.

This process has a strong impact on the volume of opt-in users.

Before explaining how to customize the opt-in process, we want to make you familiar with it and the different steps.

The user permission to send Web Push Notifications is obtained via a browser permission message, which is not customizable. It has a set design and wordings are decided by the browser.

 

Accengage provides you with 2 opt-in process :

  • One is done on the Accengage's domain (or a custom domain):
    • the opt-in process will be done through the Accengage's domain (or a custom domain) and users will be ask to opt-in through a landing page which, when displayed, will call the browser's native permission

    • This optinization process is available for websites in HTTP and HTTPs

    • Check out this documentation  to implement it
  • The other is done directly on your own domain :
    • the opt-in process will be done through your own domain and the browser's permission will be called directly without the display of a landing page (but you can set up one if needed)

    • to use this method you must integrate our SDK 3.3.x and activate this optinization method in your Accengage dashboard

    • this optinization process is available only for websites in HTTPs

    • Please, check out our FAQ to know how to implement this new process !

 

     

    Also, once the users have answered to this permission request (either with ‘allow’ or ‘block’), you will not be able to ask this permission again. If users have denied them previously, the only way users can allow them again, is to go through the browser settings... Not ideal !


    For this reason, Accengage recommends to first ask the user for its intention, with a customizable, full-html and attractive message (which is called ‘Alert’), and then, once the user has expressed will allow Web Push Notifications, to trigger the native browser permission.

    If the user does not express its intent to allow Web Push Notifications, then the permission will not be triggered, which allows you to ask for permission at a later stage. This is a great way to achieve better opt-in performance than by just triggering the native browser permission.


    The Accengage Web SDK provides a Pop-in ‘Alert’ by default, with numerous options for it to be customized simply (see the ‘basic customization’ paragraph). But Accengage also provides a library of more advanced and efficient scenarios, such as interstitial, full-length banners, buttons… (see the ‘advanced scenarios’ paragraph).

    We highly recommend you to customize the ‘opt-in’ process, as this can enhance significantly opt-in results.




    Also, as Web Push Notification permission can only be triggered on HTTPS websites, and users must give their permission for each domain or subdomain which want to send Web Push Notifications, Accengage has developed a solution to ease the process.

    This solution consists of the following:

    • Once the users have expressed their intention to accept Web Push Notifications through the ‘Alert’

    • A new Window is opened and displays an HTTPS landing page, with a unique MASTER DOMAIN (provided by Accengage)

    • In this landing page, the native browser permission is prompted (see below)

    • Once the permission is granted, the landing page registers the user to the Web Push Notifications and communicates all relevant information to Accengage.



    As a result, you can collect opt-in users from any website, any domain or subdomain (such as yourwebsite.comyourwebsite.de, or shop.yourwebsite.com…), whether http or https, and have a unified database for your Web Push Notification messages.

    See below an illustrated example used on our website in which we have customized some steps:


    Starting from version 3.3.x of the SDK Push Web, Accengage allows you to ask for the opt-in through your own domain name.

    This optout-to-optin process will follow these requirements : a link in your page > display of the browser's native permission

     

    Important

    This optout-to-optin process is available only for website working on HTTPs protocol.

     

    In order to benefit this process we recommend you to follow these steps after each other :

    (1/3) Edit the version number of your application :

    To get access to the new opt-in process of the SDK Web you should set your application version to 3.3.x.

    To do so, please go into your Accengage Dashboard : Settings > Manage application > Edit > Field Version : change it to our last version available "v3.3.x"

     

    Important

    At this stage, please keep the checkBox 'Use my own domain name' unchecked


    Click on "Save".

    Changes will take approximately half an hour before getting live.

    (2/3) Download and host to your web server the mandatory files :

    Once you've upgraded the version number of your application, to operate the new opt-in process needs a zip file to be downloaded from our interface.

    To download the zip file, please go to our interface > Settings > Manage Application > Click on the download icon at the right :


    Once you've downloaded the ZIP file, you should extract files from this ZIP. You should obtain 3 files :

    • acc_sw.js
    • acc_ww.js
    • manifest.json

    Once extracted, before going to the next step, please upload those files to the root directory of your website.


    The files "acc_sw.js" and "acc_ww.js" will be called by the SDK and the file "manifest.json" just has to be referenced in the pages where the snippet will be present.

     

    The optinization on your own domain needs a service worker running on your domain to operate (acc_sw.js)

    If you already host a service worker on your website, you'll have to merge the Accengage one with yours.

    To do so, add the lines below at the end of your service worker script :

     

    Important

    Those 3 files are only available for download to applications configured in the Accengage Dashboard with SDK's version number above 3.2.x (step 1/3)

    Those files should be uploaded to the root directory of your website, unless you already host a "manifest.json" file, you should merge the lines generated by the "manifest.json" downloaded from our interface to the "manifest.json" hosted on your server.

    Important

    You need to reference "manifest.json" in all your pages by including this tag in the <head> :

    <link rel="manifest" href="/manifest.json">

     

     

    If the "manifest.json" doesn't reside in your root directory please reference it like below :

     

    <link rel="manifest" href="/path/to/your/manifest.json">


    (3/3) Enable optin on your own domain name :

    Finally to set up the opt-in process you should enable it through the Accengage dashboard and the "modify web application" modal screen, to do so please go to our interface > Settings > Manage Application > Edit your Web App > check "Use my own domain name"

     

    Note

    Please keep the field "master domain name" unchanged.

    It should still be the domain provided by Accengage during your first integration.

    The master domain is referenced as .by-accengage.net or .notification.group if you have subscribed to a custom domain.

     

    Requesting directly the browser's native permission

    Starting from SDK 3.3.x, Accengage gives you different ways to ask a user to opt-in:

    • Display the pop-in alert (called showAlert) and then the browser's native permission (2 steps)

    or

    • Display the browser's permission when a user opens specific pages (1 step)

    or

    • Trigger the browser's permission when a user clicks on a specific link of your website

    What are the benefits of each process ?

    • Pop-in alert :

     

    It allows you to explain the benefits of your web push notification to the user.

    It can be customized to match with you're website appareance.

    Your optin process will contain 2 steps - more details in the section "3.2.1 Edit the JSON plugin configuration"

     

    • Display the browser's native permission on specific pages :



    You can display automatically the browser's native permission when a user opens a specific page of your website with your own domain name.
    To use this scenario you have to :
    1. Edit your JSON configuration on the Accengage Dashboard and set your scenario as "none" (it will prevent the display of the pop-in alert) - more details in the section "3.2.1 Edit the JSON plugin configuration" .
    2. Add the snippet on every page in which you want to display the browser's permission
      1. You want to ask the permission everywhere except page X ? Then add the snippet everywhere except page X.
      2. You want to ask the permission only on page Y; Z, W ? Then add the snippet only on these pages

    This method allows you to only have one step in your optinization process.

    Information

    Please note that if the snippet isn't integrate into a page, you'll not be able to track user's actions on that page.

     

    • Calling directly the browser's native permission :

    It gives you the possibility to display the browser's permission when a user clicks on a specific link of your website

    To do so :

    1. Edit your JSON configuration and set your scenario as "none" (it will prevent the display of the pop-in alert) - more details in the section "3.2.1 Edit the JSON plugin configuration" .
    2. Trigger the call-to-action method "requestBrowserPermission" when a user clicks on a specific link of your website :
    Argument Required Type Description
    options yes <array> of <string> containing selected anchors to bind. The value must start with "#" or "." (ID or ClassName)
    callbacks optional <object>
    • "onSuccess" : <array> provided elements that have been utterly binded
    • "onError" <string> label error
    For example


    Quick integration vs. customization

    Our solution can be fully configured. You can legitimately configure it to create the most adapted process according to the look and feel of your website.


    When you play the video, click on HD to enhance video quality

    In the following paragraphs, we will look at:

    • How to customize very easily the default Popin Alert which Accengage provides, as well as the Landing page and certain options

    • How to customize the Popin Alert in a more advanced way

    • How to create more advanced and efficient opt-in scenarios, to maximize results (we highly recommend you to create these)

    • Some useful commands to help you during these steps.

     

     

    This page intends to explicit some common use cases about the optout-to-optin customization


     

    3.2 Basic Opt-in process customization

    3.2.1 Edit the JSON Configuration

    As explained in the overview, there are 2 ways to turn a website visitor into an opt-in user :

    Through the Accengage domain (or a custom one) or your own domain.

    Depending on the optin process you're using, some customization are available.

     

    When asking the optin through the Accengage domain you will :

    1. Show an opt-in ‘ Alert ’ 
    2. Trigger a ‘ Landing Page containing the native Browser permission.

     

    Optimizing the ‘opt-in’ process by customizing the opt-in alert and the landing page can enhance significantly the volumes of opt-in users, generating better results for your campaigns. 

    We highly recommend you to customize them and we have created many tools and options to help you to do so.

     

    Starting from SDK 3.3.x, you have different ways to ask a user to opt-in through your domain:

    • Display a pop-in alert (called showAlert) and then the browser's native permission (2 steps)
      • Show the pop-in 'Alert'
      • Trigger the browser's permission when a user has clicked on the pop-in "Alert"

    or

    • Display the browser's permission when a user opens specific pages of your website (1 step)

    or

    • Trigger the browser's permission when a user has clicked on a specific link of your website

    Displaying directly the browser's permission (without displaying the pop-in 'Alert') or triggering it on specific links (option 2 and 3) can also enhance significantly the volumes of opt-in users.

    If you want to use this process please click here.

    Those scenarios have to be managed in the JSON configuration available in the Accengage Dashboard.  Please read carefully the indications below.


    Accengage has developed a Popin Alert by default, which is customizable and designed to encourage users to accept your Web Push Notifications.

    In this first step, you will learn how to very easily and quickly  customize the wording , the basic design and some display rules for this Popin Alert, directly from the Accengage  dashboard with just some HTML knowledge .

    Then we will look at how to easily customize the Landing Page, which contains the native Browser permission.

    Of course, if you would like to have a more successful and customized experience, you will be able to add your own CSS and also go further in terms of scenarios, by following the steps in the next paragraphs.


    Caution

    We highly recommend you to read through the ‘advanced scenarios’ part and try and optimize your opt-in process as it is a key driver to the volumes of opt-in users.


    This basic customization will imply modifying a Json file configuration within the application settings in the Accengage Dashboard.

    To edit these options, you can go directly on our interface. Go to  Settings  Manage Applications  Edit your application  Plugins configuration .


    Note

    When modifying these options, you will have to wait for approximately half an hour to see the changes live in your pages. However, with the Debug mode, you can speed things up (see below the paragraph Useful Commands [LIEN] to learn how you can immediately see the changes).


    Within the "push" property in the Plugin configuration, you will be able to set these parameters:

    ParameterTypeDefaultDescription
    scenario<string>"none"

    This determines which action is automatically launched as soon as the library is  loaded .

    Available values :

    • "none" : use this value if you do not want to show automatically the Popin Alert
      • typically if you want to customize when to launch it
      • or if you want a more customized experience
      • or if you want to display the the permission only on specific pages (starting from SDK 3.3.x)
      • or if you want to trigger the browser's permission once a user clicks on a specific link of your website (starting from SDK 3.3.x)  
    • "showAlert" : use this value to show automatically the  HTML alert
    alertOptions<object>see below

    Object containing the parameters for the  HTML alert

    landingOptinOptions<object>see below

    Object containing the parameters for the Landing page

    customError<object>see below

    Object containing the parameters for the customizing the Chrome Error Notification. This message is displayed as a Web Push Notification in case the servers cannot be reached.

     

    For Instance:

    For example

    3.2.2 Basic customization of the Html Popin Alert

    The HTML Popin alert is an interactive block injected by the library inside your page in order to incite users to receive push notifications and to detect their intent when they are not yet opt-in. It is an optional feature and it is the first step of the opt-in process.

     

     

    Choose when to display the alert

    You can choose the period to display the Popin Alert:

    • Automatically when a user arrives on the website (in that case, set the "scenario" option to "showAlert", click here for more information)
    • At a specific moment that you decided thanks to the method `push:showAlert` (click here to see how this command can be used in your pages)

     

    This can be combined with the automatic display of the Popin Alert when the home page is loaded. This can ensure that you get maximum visibility, as well as a relevant exposure based on what the user is doing (e.g.: on the home page automatically AND after finalizing a purchase)

     

    Customize the overall Popin Alert parameters

    By editing the following parameters inside the JSON configuration file within  the Accengage dashboard, you'll also be able to customize the wording, the basic design, the position as well as some display rules for the Popin Alert:

    ParameterTypeDefaultDescription
    contents<object>see belowLists the wordings and logos displayed to the user on the Popin Alert.
    theme<string>"light"

    Choose the theme's desgin to stylize the HTML Popin Alert. Available themes are:

    • "modern"
    • "light"
    • "custom" : no CSS will be injected, you have to customize the alert on your own (see Section 3)

    With the "custom" theme, don't forget to create your own CSS rule for the modifier class .acc--hidden (with a "display: none" for example)

    position<string>"topRight"

    Set the positions of the HTML Popin Alert. Available values are :

    • "topLeft", "topCenter", "topRight"
    • "middleLeft", "middleCenter", "middleRight"
    • "bottomLeft", "bottomCenter", "bottomRight"  
    overlay<boolean>false

    If true, this will add a semi-transparent layer between your page and the Alert. With this option activated, users won't be able to click on your page's elements

    (only applied on "modern" theme)

    Tip

    This is a very interesting option to activate in order to maximize the number of opt-in users.

    reAskingDelay<number>24

    If the user clicks on the "close" button, or hasn't interacted with the alert in a previous page, this parameter defines the number of hours to wait before showing the HTML Popin Alert again.

    When set to 0, no delay will be taken into account

    reAskingDelay2<number>24

    If the user clicks on the "deny" button, this parameter defines the number of days to wait before showing the HTML alert again.

    When set to 0, no delay will be taken into account

    If you would like to know all the details about how to set the ‘contents’ object, you can read below the part Useful Commands for more details.

     

    Customize the Popin Alert Contents

    Below is the 3 contents fields used in the HTML Popin Alert that you can modify by updating the  push.alertOptions.content object. Note that you can include some HTML code within the content.

     

    Content fieldDescriptionDefault value
    misc

    Value can be a:

    • Valid HTML <string>
    • Plain string <string>  

    the <string> value hydrating all the ".acc--miscContent" DOM Elements contained in the HTML alert

    none
    deny

    Value can be a:

    • Valid HTML <string>
    • Plain string <string>

    Hydrating all the ".acc–denyContent" component

    none
    accept

    Value can be a:

    • Valid HTML <string>
    • Plain string <string>

    Hydrating all the ".acc–acceptContent" component

    none

     

    Below are some examples of how you can modify these contents:

    Modification examples 
    Simple text changing example  Expand source

     

     

    Add HTML to add a logo  Expand source

     

     

     

     

    Customize the Popin Alert Theme

    Accengage offers preset design templates (or themes) that you can very easily choose from. We also give you the possibility to add your own design and CSS (see Section 3).

    To do so, use the content object "theme" inside the above JSON Plugin file configuration. Changing the teme will only alter the CSS file that is injected and not the HTML Popin Alert HTML markup. 

    Below are how the different themes look like:

    ThemeImages
    modern
    light
    custom (no theme apply)

    Customize the Popin Alert Position

    You can easily choose the position of the Popin Alert by modifying the position property in the JSON configuration file.

    We recommend “topCenter” to maximize the volume of opt-in users.

     

    Activate an overlay effect for the Popin Alert

    You can decide to add a semi-transparent layer between your page and the Popin Alert. In that case, users won't be able to click on your page elements. Obviously, this will highlight the Popin Alert and will drive maximum attention to it, maximizing the volume of opt-in users!

    In order to use this overlay effect, you need to choose the "modern" theme.

     

    Customize when to ask for the permission

    In order to maximize the number of opt-in users, it is important to ask the user for his permission at the right moment, and in several occasions. In order to customize when to ask the user for his permission, Accengage provides you with several options.


    First of all, as seen above, you can determine specifically when to trigger the permission thanks to the method `push:showAlert` ( click   here to see how this command can be used in your pages).

    This can be combined with the automatic display system of the Popin Alert when the homepage is loaded. This help you to ensure maximum visibility, as well as a relevant exposure based on what the user is doing (e.g: on the home page automatically AND after finalizing a purchase).


    Second of all, Accengage provides you with the Re-Asking delay options. Indeed, as long as the user has not answered to the native browser permission, you may ask them again for their opt-in, and you can set delays you wish.

       Accengage provides 2 Re-Asking delay options in the  JSON Plugin configuration :

    TypeDescription
    reAskingDelayDelay, expressed in hours (decimals are possible), before showing the HTML alert again, after the user has clicked on the "close" button of the Alert, or hasn't interacted with the alert.
    reAskingDelay2Delay, expressed in days (decimals are possible), before showing the HTML alert again, after the user has clicked on the "deny" button of the Alert.



     

    3.2.3 Basic customization of the Landing Page

    As a reminder the Landing Page is a new window which is triggered when the user has expressed its intention to opt-in thanks to the Popin Alert, and in which the native browser permission is displayed.

    You can see in the screenshot below that the native notification permission is displayed inside.


     

     

    It is also interesting to customize its text and design, in order to maximize the volume of opt-in users, as it is the last element which can encourage the users to give their permission.

    Typically, it can be interesting to reassure the user on the fact that they can unsubscribe in just 1 click, that they will receive interesting content etc.


    Accengage also lets you customize the Landing page easily via the Plugin configuration, by modifying the  push.landingOptinOptions  property.

    Below you will find the elements that can be edited in the JSON configuration:

    ParameterTypeDefaultDescription
    contents<object>see belowLists the contents displayed to the user (see below)
    theme<string>"light"

    Selected theme to customise the landing page  . Available themes :

    • "white"
    • "light"
    • "dark"
    • "black"
    height<number>135Pixel value defining the height of the popup window
    width<number>462Pixel value defining the width of the popup window
    withAppIcon<boolean>falsea flag defining if you want to display your Application Icon (The one determined in the section Getting started > Configure the Accengage Dashboard)

    If you would like to know all the details about how to set the ‘contents’ object, you can read below the part Useful Commands for more details.

     

    Here are the wordings that can be customized in the landing page, set in the  push.landingOptinOptions.contents  object:

    Content fieldDescriptionDefault value
    askCustom <string> value which is displayed immediately on the landing page (for instance to explain the benefits of web push notifications and reassure on the unsubscription)none
    grantedCustom <string> value which is displayed when the user has granted the notification permissionnone
    deniedCustom <string> value which is displayed when the user has denied the notification permission
    none
    errorCustom <string> value which is displayed when an error occurs during the opt-in process
    • "en" : "An error occured, please try again later"
    • "fr" : "Une erreur est apparue, veuillez recommencer plus tard"
    closeCustom <string> value which is displayed when the page does not close itself
    • "en" : "You can now close the page"
    • "fr" : "Vous pouvez désormais fermer la fenêtre"

    3.2.4 Custom Error option

    In very rare occasions, when the integration is not properly made or if servers cannot be reached, an error message might be displayed as a Web Push notification.

    This message can be customized in the JSON Configuration:

     

    ParameterTypeDefaultDescription
    contents<object>see belowa list of selected contents displayed to the user
    Content fieldDescriptionDefault value
    messagenotification's message"An error occurred while displaying a notification"
    titlenotification's title"Oups"

     If you would like to know all the details about how to set the ‘contents’ object, you can read below the part Useful Commands for more details.

    3.3 Advanced design customization for the pop-in alert

    In the previous paragraphs, we’ve looked at how to customize the default opt-in process in a simple way, with  little HTML knowledge  and for maximum efficiency.
    In this section, we’ll look at how to go further in customizing the user experience, and adapting the design to your own design.

     

    All the parameters, which you can set inside the JSON Plugin configuration (such as re-asking delays, position of the Alert etc.), can still be set up within the JSON Plugin configuration. The opt-in process will result in the combination of these parameters and the advanced customization done.


    You can easily add your own javascript file to override the CSS properties included in the plugin. Please find below two cases where CSS files have been added to modify the esthetics of the Alertbox

    Alertbox HTML Structure

     

    Html structure

    Example 1: Modifying pre-existing Light theme.

    We saw before that themes are CSS properties added to your page when the plugin is loaded. You can override a few properties with your own CSS files.

    Simple design modification
    Css addition

     

     

     

    Example 2: Fresh start from the blank theme


    When choosing a theme for the Pop-in within the JSON configuration, you can set it to “custom” (which corresponds to a blank theme).

    When you choose the blank theme, the HTML structure of the Alertbox is included to the DOM but NO CSS will be added.

    You can then add your own CSS file without having to override the already existing properties.

     

    For example
    Css addition  Expand source

     

    Remarks

    You can visualize a nice example of a completely customized Pop-in on our  demo page here and you can even download the Stylesheet

     


    Here is an example of a full customization

     

    3.4 Advanced opt-in scenarios

    We’ve seen in the previous sections how to customize the Show Alert which is provided by Accengage by default. However, if you would like to collect more opt-in users, we recommend you to combine and try different scenarios as well as different contexts to ask for the user permission. 

    For instance, you may ask for the user permission on the home page, but also after a specific action performed (purchase, newsletter registration etc.).

    For this reason, Accengage also provides some examples of other types of ‘Alert’ displays, such as banners, interstitials, switch buttons etc.

    You also have the possibility to create your own template.

    Below are some examples of what you can do, feel free to use these examples and adapt them to your website and ideas.

    All the parameters, which you can set inside the JSON Plugin configuration (such as reasking delays, position of the Alert etc.), can still be set up within the JSON Plugin configuration. The opt-in process will result in the combination of these parameters and the advanced customization done.


    Instertitial


    This example is impactful given the attention it drives. 

    Also, the volumes of opt-in users are maximized as the overlay disables the navigation behind.

    You can achieve high numbers using interstitials! 

    You can visualize it on our demo page and re-use the code if needed.

     

    Illustration of an instertitial


    Full width banner


    This example is a good compromise between impact and non-intrusiveness.

    It looks very similar to the banners which are displayed for cookie acceptancy, so users are accustomed to seeing them on websites.

    It has the advantage that you can show it at the top of all the pages of your website during the user navigation. You could also decide to display it from the bottom as the user scrolls down, in which case we recommend you use it in combination with another display seen from the top.

    You can visualize it on our demo page and re-use the code if needed.


    Opt-in Button


    This example can be very useful if you would like to maintain a permanent button on your website to encourage users to give their permission, similar to a “register to our newsletter” button.

    The example below shows an animated bell that you can position as an overlay on your website

    You can visualize it on  our demo page and re-use the code if needed.



    Switch Button


    This example can be very useful if you would like to maintain a permanent button on your website to encourage users to give their permission. It can also be added during a form registration. 

      The Accengage website ( http://www.accengage.com ) shows an example at the top of the screen. 

    You can visualize an example on  our demo page and re-use the code if needed.

     


    Check box in a form

     

    Taking advantage of a form is a good additional way to ask for the user permission.

    Note that we recommend not to only rely on this form, as a lot of users do not go through forms. But it’s a good way to catch a high percentage of your more engaged users.

    You can visualize an example on  our demo page and re-use the code if needed.


    The Accengage website ( http://www.accengage.com ) shows a nice example of that.


    You can access the  demo page  to see an example of the SDK's integration.

    3.5 Scenario triggering options

    Together with the design, the timing of the Alert display can prove to be a key factor for the opt-in process performance. 

    Asking the user's permission directly from the Home Page is an important and recommended step, however, asking them in other contexts (e.g.: at the end of a purchase, of a registration, on a deep page etc.) is also important and should be used in combination with a request on the Home Page.


    In order to use the functions described below, you will need to create some commands within the Javascript. To see how to proceed, please read paragraph 3 of Section ‘Web SDK Integration’.


    Triggering the Popin Alert when you want

     

    If you want to use the default or customized Show Alert, Accengage gives you the opportunity to choose when to display this it  :

    • Automatically when a user arrives on the website (set the push plugin "scenario" option to "showAlert", click here for more information)
    • At a specific moment that you decide thanks to the method `push:showAlert ` (click here to see how this command can be used in your pages)

    Please refer to the API Documentation for complete details

     

    Use the push:showAlert command when you want to show the HTML alert to the user.

    ArgumentRequiredTypeDescription
    optionsoptional<object>

    a new set of parameters that can override the configuration of your application (see the "alert configuration" section to check all the possibilities)

    callbacksoptional<object>
    • "onSuccess" : <void>
    • "onError" : <string> label error

     

    For Instance:

    For instance

    Triggering Landing Page following a custom scenario

     

    In order to launch your own custom scenarios at a desired moment, Accengage has created a method to let you trigger the landing page (where the native web push permission is asked) following your custom Alert scenario.

    It's the push:launchLandingOnClick command.


    Use this command to bind one or more DOM Anchor Elements (</a> tag) to launch the optout-to-optin landing page on click.

    ArgumentRequiredTypeDescription
    optionsyes<array>of <string> containing selected anchors to bind. The value must start with "#" or "." (ID or ClassName)
    callbacksoptional<object>
    • "onSuccess" : <array> provided elements that have been utterly binded
    • "onError" <string> label error

     

    For Instance:

    For example

     

    Before launching your custom opt-in scenario, you may want to know if the user is compliant with Web Push Notification requisites , and/or if the user is already opt-in or not.

    To know whether the user is already opt-in to Web Push Notifications, you can use the core:isCompliantWithPushPlugin command.  It can also tell you why the user is optout,

    e.g. if he has denied the native notification permission.

    Use this command to know if the user is compliant with the Push Plugin

    ArgumentRequiredTypeDescription

    options

    not used  
    callbacksyes<object>
    • "onSuccess" : <void>
    • "onError" : <void>
    For instance


    You can add some custom listeners to the events which are triggered by the library such as when the landing page is displayed, when the user has granted permission etc.  

    Please refer to the API Documentation for complete details JS doc.


    3.6 Useful commands

    3.6.1 How to set up the contents object in the JSON plugin configuration

    The contents <object> contains a list of propertiesaccording to the plugin configuration itself.

     Hence, here is a possible example of configuration, to manage for instance multi-lingual messages:


    Enable Debug Mode to bypass cache settings

    Our solution provides a Debug Mode allowing you to keep a stack trace accessible through your browser console. 

     Also, as explained above, when modifying the JSON plugin configuration options, you need to wait for approximately half an hour to see the changes live in your pages. However, with the Debug mode, you can bypass the application's settings cache and speed things up to see the changes.

     

     

    It won't destroy the current cache though, other users will keep seeing the cached version.



    To use the debug mode, just follow these steps:

     

    3.6.2 Enable debug mode to bypass cache settings

    Our solution provides a Debug Mode allowing you to keep a stack trace accessible through your browser console. 

    The debug mode can also bypass the application's settings cache. For example, you have made some changes on our interface for your application, and you don't want to wait thirty minutes to see the modifications. Use the debug mode avoid this wait and see the changes (it won't destroy the current cache though, other users will keep seeing the cached version).

    To use the debug mode, just follow these steps :

    1. Enable the checkbox on our interface > Settings > Manage Applications > My application > Allowing debugging.
    2. It will create an "ACCdebugKey". To activate the debug mode, you just have to include it in your page URL as query string parameter
    3. For example, if your current page is http://myWebsite.com/page.html, just add : http://myWebsite.com/page.html?ACCdebugKey=XXXX

    On Google Chrome (or Firefox), you can access the console by

    • Using the keyboard shortcuts
      • On Windows and Linux: F12
      • On Mac: Cmd + Option + I
    • Then go to the ‘Console’ panel

    • No labels