Avoid These Terrible Web Notifications Mistakes! 🤦‍♂💥
Tags: performance, webdev, beginners, programming
Published: 2021-02-03 09:18:47

This article is a brief introduction to some best practices about web notifications and some typical mistakes we should avoid. 

We have several instruments to measure users engagement, such as downloads or clicks. Highly engaged users tend to be more profitable as typically they conclude purchases and share the website content within their network.

> When we consider push notifications, engagement can be measured as the average number of sessions the recipients generated by receiving the message within a defined period of time. 

![engagement](https://thepracticaldev.s3.amazonaws.com/i/myslu3jc5phbzcpcsf80.PNG)

Push notifications are a powerful channel to keep an interactive contact with our users and reach out to them even when they aren't visiting our web site.

Commercial newsletters allow for fake user data (do you always provide your real information in any newsletter? :smile:).
Conversely, it is not possible to falsify credentials with web notifications, but they can be a double-edged sword.

We can build an amazing web app but if we do not use notifications properly, we flood the users with irrelevant information. Either they will be annoyed or the message we wanted to send across will be swallowed by too much information.
&nbsp;

# The benefits of push notifications

Push notifications can bring benefits to different business fields.

![push-benefits](https://thepracticaldev.s3.amazonaws.com/i/yl132dobm4jktlikgaaz.png)
&nbsp;

## E-commerce: a practical case
Let's take a common scenario. A potential customer browses among our e-shop articles and puts one item in the cart for the purchase. However at the very last checkout step additional costs - shippings costs, gift options, express delivery - might pile on top of the original price. At this point the customer second-guesses his/her choices and aborts the purchase.<br>
 A study by [hosting facts](https://hostingfacts.com/internet-facts-stats/) says that 66 percent of shoppers have decided not to buy an item they were considering buying due to shipping costs.

We can track these "abandoned" items left in the shopping cart. At a certain point our marketing department might decide to launch a new sales campaign. This would be the perfect time to send a message to all those users who left some articles in the cart. If those objects are now 30% - 40% cheaper, it is more likely that the user is going to conclude the purchase this time.

![usefuls_notification](https://thepracticaldev.s3.amazonaws.com/i/w4owuzdw38qxz582dwrz.png)

This is just one possible example, but there are many more opportunities: shopping websites can send an email when a piece of clothing that was out of stock is available again or when a parcel has been handed over to the shipping courier.
&nbsp;
# Common mistakes to avoid

As we mentioned earlier, the misuse of web notifications results into a negative user experience.

<figure class="image">
  <img src="https://thepracticaldev.s3.amazonaws.com/i/vp2mu3pe6106tjbhs7g5.PNG" alt="push-spam">&nbsp;
<figcaption>source: https://vwo.com/ebooks/push-notifications-report-2018</figcaption>
</figure>
&nbsp;

What can go wrong:

- **Wrong timing**. You should be able to collect geographical details to segment the audience according to their location. This allows for so called *geo-push* notifications. If you want to inform that your latest tech article has been published, probably the best time to reach your readers is between 6am and 9am when many people are commuting to work. In order to do this, the server push logic needs to take into account the recipients time zone.
&nbsp;

- **Impersonal data**. Provide information tailored to the recipient, addressing him/her by name or references to previous interactions. For this reason we should always record the transactions with our users in order to create a detailed context allowing for a more precise customers segmentation.
&nbsp;

- **Unclear actions**. The context and interaction option of a notification have to be immediately clear and accessible. In the example below, the type of notification and the actions that can be taken are easily identified:
&nbsp;
![push_action](https://thepracticaldev.s3.amazonaws.com/i/ix5pzmu6bsrw0krhlw3h.PNG)
&nbsp;

- **Too many**. Even if we can provide information of interest for our recipients, we should carefully evaluate the frequency of a notification. Otherwise our messages will be simply perceived as annoying spam.
&nbsp;
![too_many](https://thepracticaldev.s3.amazonaws.com/i/mbf5z8s9e7gt71ljrxoq.png)
&nbsp;

With these concepts in mind, you should be ready to plan your notifications strategy with the most effective impact on your target users.

Do you have any further methods or measures you adopt in your web notifications strategy? Share them with us in the comment below!