How We Built Our Location-Based Notification System To Increase Click-Through Rates

Rohit Jain
From LBB
Published in
3 min readFeb 5, 2019

An average mobile user launches 9 apps per day so it’s super important to stay as relevant as possible in order to be one of those 9 apps.

At LBB, we reach out to millions of users every month to help them discover AWESOME local businesses across more than 22000 localities. So sending highly personalised location-based notifications was key for us to generate higher user re-engagement.

Key factors to consider

  1. Relevance of content
  2. Time
  3. User’s location

Challenges to face

  1. Sending a limited number of notifications (since too many notifications result in app uninstalls)
  2. Location relevance i.e. when a user’s location has changed and the user is stable at that particular location (under 500 m radius) for at least 30 minutes
  3. Time relevance i.e. the notification should land while the user is still at that location
  4. Avoid sending notifications of the same place again & again so it doesn’t seem spammy
  5. Design for scale as the system should be able to handle millions of devices

Engineering Challenges

  1. Limit number of device location API calls and rest API calls. Both location and rest API network calls can drain device battery, clearly an app uninstallation threat
  2. How to calculate if a user is stable at a particular location
  3. How to handle real time requests if all the millions of devices start to call our API server with location coordinates

Solution

  1. Getting user’s location from the device

This was achieved by using Location APIs available in Google Play services. We made sure to make fewer location API calls by only fetching devices located at a certain time of the day + fetching locations at a fairly low frequency like every 10–15 minutes (to only know when there is a major change in the user’s location). We could then easily calculate the user’s location change and the user’s stability (stability within 2 km radius). Now, the device knows when to inform the server about any location change.

2. Building a location notification micro-service

We wanted to build a reliable system (i.e. a micro-service) that is capable of handling millions of requests and is maintenance free. So instead of building the entire tech stack, we looked at AWS for a possible combination of AWS services available that can serve our purpose.

AWS Kinesis + Lambda served our use case.

AWS Kinesis — Amazon Kinesis Data Streams (KDS) is a massively scalable and durable real-time data streaming service and allowed us to capture location information from millions of users in real time (without any overhead maintenance costs).

AWS Lambda — It lets you run code without provisioning or managing servers and since AWS lambda can read Kinesis Data Stream, it meant we can process the data stream without worrying about maintenance and provisioning.

We also wanted Lambda to process extremely fast so we ensured all processing happens at cache layer i.e Elastic Cacheinstead of hitting our databases.

Outcome

The click-through rate via these push notifications were 2–3X higher in comparison to other push notifications.

--

--