AMP Web Push
Implement web push notifications on AMP web pages
AMP pages support mobile web pushes on Android devices only.
Overview
AMP is an open-source Google framework for developing user-first web pages loading nearly instantaneously.
Integrating the AMP Web Push component into your AMP web pages, you can reach out to your customers when they’re surfing the web on their mobile browsers.
Integrate AMP into your website
Add the following files to your website’s root directory:
There are two customizable blocks in the permission-dialog.html
file:
Where:
{Subscribe to push notifications} — a CTA message asking users to allow push notifications;
{Unblock push notifications in your browser settings} — a CTA message prompting users to unblock push notifications in their browser settings (in case push notifications are explicitly blocked by a user).
To customize the permission dialog appearance, add the following code to the <head>
tag:
Integrate AMP Web Pushes
To implement web push notifications on AMP pages, add the amp-web-push component to each AMP page.
To do so, follow these two steps:
1. Add the following script to the <head>
tag:
2. Add the following code to the <body>
tag:
Where:
{domain} — your website URL,
{applicationCode} — your Pushwoosh app code,
{senderId} — Sender ID from your Firebase console,
{applicationServerKey} — Server Key from your Firebase console,
{Text on Subscribe button} — a text on a button enabling push notifications,
{Text on Unsubscribe button} — a text on a button disabling push notifications,
{Fallback if a user blocks notifications} — a fallback block that is displayed when a user blocks push notifications.
To customize buttons’ style, add the following code to the <head> tag:
To check whether you’ve done everything right, please use https://search.google.com/test/amp
Last updated