Single Page App (SPA) Support
If your website is a Single Page Application (SPA), then by default, MoEngage SDK does not track MOE_PAGE_VIEWED
event on route change since the whole page does not reload.
In order to get the MOE_PAGE_VIEWED
event tracked on every route change, pass enableSPA: true
while initializing
Moengage = moe({
app_id: moeAppID,
debug_logs: 0,
enableSPA: true
});
Custom Approach
If you want to track MOE_PAGE_VIEWED
on your own (it may be that the routes are changing even for some functionality and not only on page change, like opening login popup and so on), then please use Moengage.track_page_view()
whenever you want to track MOE_PAGE_VIEWED
event.
Progressive Web Apps (PWA)
Progressive Web Apps (PWAs) are web apps that use service workers, manifests, and other web-platform features in combination with progressive enhancement to give users an experience on par with native apps.
Browser Support
As of today, Jan 2023, it is supported in Chrome and Edge Web browsers and all mobile browsers except Opera Mini and Partial support in Safari iOS.
Ref: "PWA" | Can I use... Support tables for HTML5, CSS3, etc
Moengage WebSDK support
All the functionalities will work as they are. As for Web Push, the browser via which the PWA is installed needs to remain open or should be running in the background in order to receive the web push notifications.
Sample Code has been added here.
Reach out to us directly from your MoEngage Dashboard -> Need Help? -> Contact Support or send an email to support@moengage.com.