As the web becomes more powerful and there are more ways to engage with users, we must remember to use the new power responsibly.
I've been seeing a disturbing new trend far too often lately. I click on a link I find somewhere, the page loads, and then this pops up:
I've never been to your website before, Oklahoma Channel 4. I haven't even spent enough time here to read a single article. Yet you think I might be interested in signing up for what is no doubt a barrage of daily "breaking news" alerts from you?
This is the best way to not only slightly irritate your users, but to ensure that they won't register for push notifications. This is a lose-lose situation.
Mobile app developers have had access to push notifications for many years. It has always been a best practice to ask for push notification permission with a value proposition, often after a positive interaction. For a news site, this is likely after you've noticed a user has come to your site and read a few articles from start to finish. They obviously like your content at that point, so wait until then to hit them with the push notification option. For an e-commerce site, this might be after a user has bought a product. At that point, let them know they can be notified about important delivery updates, but don't hit every brand new user to your site with such a prompt.
Another feature you may have noticed in the screenshot above is the red bell icon in the bottom right corner. This is also a part of the OneSignal SDK, and it appears that by default it is always fixed in a corner of the page as you scroll. I have not used their product so I don't know if this is opt-in or not, but I'm seeing it on too many sites. Think about it — there is a
position: fixed icon of which the only purpose is to trigger a prompt asking if you want push notifications. No you say? The bell icon stays in case you (presumably) change your mind. This is crazy, because no self-respecting native app would do this. If you want to provide an opportunity for re-engagement of push notifications, try putting a button at the bottom of your news articles (because only users who are genuinely interested in your content will see it). Or place the button on a thank-you page after a user purchases a new item. Make it a value proposition to users with a track record of engagement. Don't spam all users all the time, that's a horrible experience.
This advice doesn't stop at push notifications. The same practices should be extended to any powerful web platform feature that requires prompting the user for permission, such as camera access or installing a progressive web app. Browsers could theoretically try to mitigate spammy behavior with more sophisticated logic around showing these prompts, but it's likely this would also create more trouble for developers who are already doing it correctly. That's definitely not ideal.
Please think about your users before implementing powerful features like push notifications, and help keep the web a great platform for everyone!