AMP integration
For AMP integration push subscribers to Notix you need to:
- Create a tag inside Notix SSP
- Download the service worker and upload it into your site as a file
- Download the AMP request permissions pages and upload it into your site as a file
- Copy code from "AMP integration - html for head" and paste it into your site on head tag
- Copy code from "AMP integration - html for body", replace the text "yourAppId" with the AppID you received when creating the tag (first step) and paste it into your site on body tag
AMP integration - html for head
<script
async
custom-element="amp-web-push"
src="https://cdn.ampproject.org/v0/amp-web-push-0.1.js"
></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<meta name="viewport" content="width=device-width">
<script
async
custom-element="amp-form"
src="https://cdn.ampproject.org/v0/amp-form-0.1.js"
></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
AMP integration - html for body
<amp-web-push
id="amp-web-push"
layout="nodisplay"
helper-iframe-url="/notix-amp-frame.htm"
permission-dialog-url="/notix-amp-permission-dialog.htm"
service-worker-url="/sw.enot.js?appId=yourAppId"
></amp-web-push>
<amp-web-push-widget visibility="unsubscribed"
layout="fixed"
width="500"
height="70">
<button on="tap:amp-web-push.subscribe">
Subscribe to Notifications
</button>
</amp-web-push-widget>
<amp-web-push-widget visibility="subscribed"
layout="fixed"
width="500"
height="180">
<button on="tap:amp-web-push.unsubscribe">
Unsubscribe from Notifications
</button>
</amp-web-push-widget>