-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compute number of views for the push notifications sent? #386
Comments
Sounds like you're looking for something that can do impression tracking. That's not specifically something to do with the W3 push-api. That said, to do so you'd want to just make a GET/POST to an external url when you are showing your push that handles that for you. If you use something like simple like ProxyHook you'd do:
|
A There is a reason if the Push API now supports a payload: that was added later because downloading a payload via As for the reasons why a notification is successfully sent but not displayed to the end user, there can be many reasons: |
Hello! I'd improve @nerdysherpas code a bit to leverage Example similar to the one from my "Web Push Notifications Done Right" session:
@myupchar you can also get extra insights about interactions with your notifications by calling analytics API inside |
Does it also work in practice? A few years ago we had very poor/unreliable results... The explanation was that the "push" event can be processed even during a "power-saving" status where opening new connections may not work. Basically the connection used to receive the notifications on mobile has a special status. Consider that the entire idea of the Push API is to save bandwidth/energy by using a single connection to fetch events about all websites and apps. If you open random connections to random hosts each time that you receive a message... I don't know if that is planned and if it works reliably. |
@collimarco, I don't have any statistics on failed fetch-in-push ratio so can't really reason about reliability. But this approach is regular for Web Push delivery services. For example, SW by Pusher. And this analytics call is marked as "best efforts" there as well - confirming your concern. If we develop this idea towards its robustness, we can leverage something similar to what was implemented in workbox-google-analytics module (that is unfortunately not compatible with GA 4+): all failed requests stored in IndexedDB and then "synced" using Background Sync API (that is not available on iOS though) |
We have a large number of subscribers at https://www.myupchar.com/en but we are not sure how many successfully see it? Is there a way to track it?
We are seeing 10million+ subscribers and only 4-5K visits. If we can get a view count, it will greatly help
The text was updated successfully, but these errors were encountered: