samagra-comms / uci-apis

Unified Communications Interface (UCI) is a system that powers governments to create and manage conversations with citizens and with its own officials. Through UCI governments can seamlessly setup simple and complex conversations using a multi-channel approach. UCI aims to democratize the use of different communication channels such as WhatsApp, Telegram, SMS, email for governance use cases through a standard configurable manner that is reusable and scalable across all governance use cases.
12 stars 30 forks source link

[Android] Debugging why PN not sent to all users #175

Closed karntrehan closed 1 year ago

karntrehan commented 1 year ago

Description: From the recent bot triggering exercise we have observed that ~40% of all users, to whom we successfully send notification, receive notification. The drop is quite massive and we want to know ways of improving it.

karntrehan commented 1 year ago

Google mentions that we should target users with token less than 1 month old. Source: https://firebase.google.com/docs/cloud-messaging/manage-tokens

We currently have 1,33,407 tokens in the system. Created this sheet with the mentor token age with help from @choxx : https://docs.google.com/spreadsheets/d/1-PS0FNf31l61q9M2Uvh_jrVc9oiJGZXFk2wS903owLU/edit?usp=sharing

Summary:

Image

We can target 88,289 mentors with token less than a month old. Which is ~66% of the total 1.33L tokens.

Reach:

Currently we are reaching 42K users which is ~48% users of 88,289 reachable users.

Next steps:

  1. Look at users who could be offline.
  2. Users with notifications turned off.
  3. Users who have uninstalled the app.
  4. OEM issues.
aakashyadav-kgp commented 1 year ago

Top of funnel. i.e., total target group is almost 95% of cohort we want to send notification to. For now we are focusing on getting more accurate notification received data because we feel there some data leak happening on posthog. Therefore we are not getting the exact data there. Exploring firebase for the same.

karntrehan commented 1 year ago

Blocked on lack of bandwidth

aakashyadav-kgp commented 1 year ago

@karntrehan I did one round of debugging. Found that more than 1.5L token are < 30 days. Theoritically we should be able to send notification to these users.

Contrary to this we are getting ~50K unique users who are receiving notification on posthog. Also this no could reduce by further 25% when looked at specific user id as we have seen the logic of unique users is diff on posthog.

We should debug this on priority!

Image

karntrehan commented 1 year ago
pankajjangid05 commented 1 year ago

Add botId to the analytics object of notifications is done

Image

geeky-abhishek commented 1 year ago

Maximum Value- 4 Week.DB architecture is under process.

geeky-abhishek commented 1 year ago

Need schema approval from @chinmoy12c .

pankajjangid05 commented 1 year ago

Delivery report new database was created and related changes are done. PR is created and waiting for Chinmoy's approval.

Inbound Outbound

geeky-abhishek commented 1 year ago

@pankajjangid05 to deploy it today on staging

karntrehan commented 1 year ago

Production deployment broke redis cache. To be hotfixed and deployed today. Numbers to be compared for new bots triggered from tomorrow.

pankajjangid05 commented 1 year ago

Deployment done Production is working fine.

karntrehan commented 1 year ago

Fixes released in v1.7.3 of NL.