AMP Support

You may also prompt your visitors for Web Push permissions via AMP pages.

Web push AMP support is not recommended due to poor user experience and low percentage of opt-ins.

Integration Steps

Step 1: Download & Place Required Files

Download the following files:

In the pushly-amp-helper-frame.html and pushly-amp-permission-dialog.html files replace the REPLACE_WITH_DOMAIN_KEY placeholder text with the Domain Key from the platform.

Place all 3 files in a publicly accessible directory on the domain for which you are going to opt-in visitors.

Step 2: Include the AMP Project Javascript

Include the following script tag on your AMP pages in the HTML head section. Ensure that the AMP page does not include the main Pushly SDK snippet.

<script async custom-element="amp-web-push" src=""></script>

Step 3: Include the `amp-web-push` component

Include the following `amp-web-push` tag within the HTML body on your AMP pages.

Ensure the URLs to each of the files placed in Step 1 are accurate in the final snippet.


Step 4: Add Widgets

Add the following code blocks to the page wherever you want the subscribe and unsubscribe widgets to show.

We recommend placing these widgets between article paragraphs and/or at the bottom of each article.

Subscribe Button

<amp-web-push-widget visibility="unsubscribed" layout="fixed" width="245" height="45">
  <button class="subscribe" on="tap:amp-web-push.subscribe">
    Subscribe to updates

Unsubscribe Button (Optional)

<amp-web-push-widget visibility="subscribed" layout="fixed" width="250" height="80">
  <button class="unsubscribe" on="tap:amp-web-push.unsubscribe">Unsubscribe from updates</button>


You may customize the CSS and widgets as long as you ensure the amp-web-push-widget and subscribe/unsubscribe buttons exist.

Last updated