Unlocking the Secrets to High Conversions" - Take your email marketing to the next level with this ebook, which covers advanced tactics such as segmenting your email list, optimizing your email design, and personalizing your messaging.
AMP – or Accelerated Mobile Pages – is a project backed by Google that aims to make the loading of mobile web pages much faster.
According to Google, 40% of people abandon a website that takes more than 3 seconds to load. This demonstrates that users expect websites to load almost instantaneously.
Essentially, AMP pages work by using a lighter version of HTML that allows websites to load much faster than regular HTML.
As google give AMP pages more importance in search engines, you will get hell out of traffic. So it will be better idea to implement web push notifications on AMP pages and increase your subscribers.
There are 3 simple steps to implement Web Push Notifications:
1. Start with an empty html page with basic html structure. Add the script tag given below in your head section. This will load amp-web-push library provided by amp project.
<script async custom-element=”amp-web-push”
src=”https://cdn.ampproject.org/v0/amp-web-push-0.1.js“>
2. Now create a widget to give user to subscribe to push notification. Make two buttons , one for subscribe and one for unsubscribe. You can remove unsubscribe button but it will recommended by google for better user experiences. Add this code in body part.
<!– A subscription widget – subscribe button –>
<amp-web-push-widgetvisibility=“unsubscribed“ layout=“fixed“ width=“250“ height=“80“>
<buttonon=“tap:amp-web-push.subscribe”>Subscribe to push Notifications</button>
</amp-web-push-widget>
<!– An unsubscription widget – unsubscribe button –>
<amp-web-push-widget visibility=“subscribed“ layout=“fixed“ width=“250“ height=“80“>
<button on=“tap:amp-web-push.unsubscribe“>Unsubscribe from push Notifications</button>
</amp-web-push-widget>
Note : Visibility tag is required here. Visibility will take three value namely subscribe , unsubscribe or blocked . Widget will show and hide on the basis of user’s subscription state .For ex. first time user will see widget with visibility unsubscribe and if user subscribe the push, he will see widget with visibility subscribe .
3 . Now it’s time to install service worker and other configuration. For this you have to integrate three files in your root folder of our web site and your site must be on https. This three files are as following:
You can download these files by clicking on them.
<amp-web-push
helper-iframe-url=“https://example.com/helper-iframe.html“
permission-dialog-url=“https://example.com/permission-dialog.html“
service-worker-url=“https://example.com/service-worker.js“
></amp-web-push>
helper-iframe-url : This page works as a mediator between amp and service worker, to enable communication which subscribes and unsubscribes the user. Notification permission status is also determined by this page.
Permission-dialog-url : This page is for user interaction which open a page as a pop up and prompts for notification permissions.
Service-worker-url : As you know it will run in background which subscribe, unsubscribe the users or display notifications to them.
If you don’t know about Service Workers, you can use third party sites which provide complete solution for Web Push Notifications like NotifyVisitors
Important Points to note to activate Web Push Notification on your AMP pages.
Building a strong connection with customers is vital for any business to thrive in a…
Email marketing has always been an effective way for businesses to connect with their audience,…
Mobile applications are an essential tool for our day-to-day activities. Every user wants mobile applications…
Blueshift is a well-regarded customer data platform (CDP) known for its sophisticated AI-driven marketing solutions…
The digital landscape is evolving at lightning speed, and with it comes a new buzzword…
Identifying the right customer data platform (CDP) can open new doors for your brand, allowing…
View Comments
May describe in detail how and where to paste these codes
Hi Vikas,
Thanks for sharing this with us. Arman from our team will send you an email explaining this feaature.
He can be reached over email@: arman.a@notifyvisitors.com
Looking forward to work together.
Sir do i need to upload html pages to root folder [ public_html }
Hi Maqbul,
All files must be in root folder and your site must be on https.
If you need any further help you can mail us on arman.a@notifyvisitors.com
Thanks
nice work plz provide some more tips
Hey, Its nice but How can I use firebase push notification on amp page?