Reputation: 101
We have deployed the chrome service worker on our website in July 2015 and have over 380K active subscribers of which over 90% are mobile devices. But we are encountering issues with the service worker. When a user's cache gets cleared or when many of the mobile apps like cleanmaster and other utility apps on a phone clear cache on a user's mobile. In that case we do not have any access to device token of that user. And hence even with 380K active users for which google sends us message ids we only get 50K impressions which is a very low ratio. Our push notification subscription is implemented on a seperate subdomain as we could not make the entire site https then.
I have 2 queries:
Upvotes: 7
Views: 2043
Reputation: 9831
When a user clears their cache in Chrome, it also unregisters service workers and clears the window cache as well. By unregistering the service workers it will unsubscribe the push subscriptions.
I agree that it's hard to understand the link between clearing a cache / cookies and how that relates to service worker and push notifications from the UI - the Chrome team are aware of this.
The best advice with respect to getting those users back is to ensure that when ever a user enables notifications and you get a subscription object, keep track of that decision as their last known decision and when the user re-visits your site, if they should be subscribed and you have permission, you can get a new subscription and send that back to your server.
I put together this blog post: https://gauntface.com/blog/2016/05/01/push-debugging-analytics
Looking at your site there are a few issues in your code:
Checkout the blog post above, it covers how I came to that conclusion and some advice on how to fix it.
Upvotes: 7