HTML Prompt

Allow users to express their interest in notifications prior to registration.

This plugin provides a utility that allows users to express their interest in receiving notifications prior to registering their channel.

It is a best practice to explain the value of your notifications before prompting the opt-in flow. Using a soft prompt also gives users the chance to politely decline for now, without setting the browser permission to denied, giving you the chance to request again at a later time.

Two HTML prompt templates are available:

TemplateDescriptionExample image
AlertA basic alert, with configurable title, message, logo, and button fields
BellA small bell that stays fixed on the page

Loading the Plugin

The URL will differ depending on whether you are using our North America or EU data center:

Data center locationURL
North Americahttps://aswpsdkus.com/notify/v2/ua-html-prompt.min.js
EUhttps://aswpsdkeu.com/notify/v2/ua-html-prompt.min.js
Loading the HTML Prompt Plugin (US Data Center)
UA.then(sdk => {
  sdk.plugins.load(
    // globally unique plugin identifier; we always use `html-prompt`
    'html-prompt',
    // URL to the html-prompt script; this example is for the US data center
    'https://aswpsdkus.com/notify/v2/ua-html-prompt.min.js',
    // options passed to the plugin
    {type: 'alert'}
  )
})

See below for the full list of options you may use when loading the plugin.

Options

Options for the alert and bell templates:

KeyTypDescriptionDefault value
typestringTemplate to use, one of alert oder bell.alert
appearDelaynumberDelay, in milliseconds, before displaying the prompt. Useful when auto is set to true.0
disappearDelaynumberDelay, in milliseconds, before the prompt automatically disappears0
askAgainDelaynumberDelay, in seconds, before prompting user again after dismissing or ignoring the prompt1209600 (2 weeks)
stylesheetstringCSS Stylesheet URL to customize the prompt appearancenull
autobooleanControls automatically displaying the prompt on page loadfalse
UAstringUA global variable used in your SDK snippet. Only use if you have overridden the default global variable.UA

Options for the alert template only:

KeyTypDescriptionDefault value
positionstringThe position of the alert on the webpage, one of top oder bottomtop
i18n.{lang}.titlestringAlert title'Subscribe to our notifications'
i18n.{lang}.messagestringAlert messageen: 'Stay tuned and get our best offers by subscribing to our push notifications.'
i18n.{lang}.acceptstringLabel for Accept buttonen: 'Yes, Subscribe me!'
i18n.{lang}.denystringLabel for Deny buttonen: 'No thanks'
logostringLogo URL to be displayed in the alertnull