Frequent alerts can lead to notification fatigue, causing users to disengage. I knew that by batching notifications, we could maintain user attention and promote sustained interaction with our platform. However, setting up an efficient batching system required some complex workflows and significant development resources.
You can explore the hands-on implementation through the following links:
- GitHub: Github Social App
- Deployed Application: Github Project Demo
The concept of batching notifications involves several technical components:
To demonstrate this, I chose to build a React application using SuprSend's robust notification infrastructure. Here’s a step-by-step account of how I did it:
Setting Up the Project:
I started by creating a React application and integrating SuprSend's SDK.
I set up a SuprSend account and ensured successful event calls were made to SuprSend with the necessary details.
Identifying Triggers:
I identified recurring events suitable for batching. For this demo, I used the Like_Event
whenever someone likes a post. Using SuprSend’s JavaScript SDK, I sent these events to the backend.
Configuring Batch Parameters:
Batch Window: I set a fixed batch window of 15 seconds for quick testing.
Batch Key: I defined a custom batch key based on the userName variable to batch likes on different posts separately.
Retain Batch Events: I chose to retain 15 objects in the array for this demo.
Creating Notification Templates:
I created templates in SuprSend’s editor using Handlebar Helpers to format notifications based on the batched event count. The template looked like this:
{{#compare $batched_events_count '>' 1}}
{{ $batched_events.[0].username }} and {{ subtract $batched_events_count 1 }} others liked your post.
{{else}}
{{ $batched_events.[0].username }} liked your post.
{{/compare}}
A neat batched notification.
While batching reduces the total number of notifications, I realized that introducing throttling could further enhance user experience by limiting the frequency of notifications. Users would not be overwhelmed even with multiple batches by setting an upper limit on daily notifications. Will tell in next tutorial how I implemented that.
The final demo application successfully demonstrated how batching notifications could improve user engagement. You can explore the hands-on implementation through the following links: