Web Push
We are no longer updating this site. For user documentation, please go to User Docs. For developer documentation, please go to Developer Docs. If you have any questions or feedback, please submit a ticket.
If you want to create your own web push subscribe experience, Zaius supports custom initialization options.
To manually handle Web Push initialization (instead of automatically initializing) go to step 5 of Web Push wizard within Zaius: Account Settings -> Integrations -> Web Push
Integration of web push will not be marked as "live" but should be configured.
In JavaScript on your website, AFTER Zaius is initialized, perform any JS logic and call this when you are ready to show the subscription UI:
{
"codes": [{
"code": "zaius.dispatch('webPush', 'initialize', {websiteID: ''})",
"language": "javascript",
"name": "Show Subscribe"
}]
}
websiteID
is the name given in the web push subscribe setup, NOT your tracker_idIn JavaScript on website, AFTER Zaius is initialized, perform any JS logic and call this when you are ready to show the subscription UI:
zaius.dispatch('webPush', 'initialize',
{websiteID: '<ZAIUS_WEBSITE_ID>',
subscribeUI: {enabled: false}}
);
//Then, check the subscription status before showing your subscription UI:
zaius.dispatch('webPush', 'subscriptionStatus', function(status, token) {
if (status !== 'subscribed' && status !== 'denied') {
// show subscribe UI
}
});
//Finally, when you want the browser to ask the user to allow push notifications call:
zaius.dispatch('webPush', 'askToSubscribe');
Last modified 8mo ago