Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Notifications: record analytics for every showNotification #1524

Open
ebidel opened this issue Jun 12, 2015 · 1 comment
Open

Notifications: record analytics for every showNotification #1524

ebidel opened this issue Jun 12, 2015 · 1 comment

Comments

@ebidel
Copy link
Contributor

ebidel commented Jun 12, 2015

It was a mistake not to record these calls to GA. We know how many notifications were sent from GCM, and how many user clicks on notifications, but not how many push events the sw's actually recieved :(

https://github.com/GoogleChrome/ioweb2015/blob/e33352f89034e77f54afdb1fc685439f3962803a/app/scripts/shed/push-notifications.js

cc @jeffposnick

@jeffposnick
Copy link
Contributor

It would be messy to go about doing that.

AFAIK, the standard Google Analytics JS library won't play nicely with the ServiceWorkerGlobalScope, and I don't think there's an official way of constructing GA ping URLs "by hand".

One approach would be to use IndexedDB to queue up details about the incoming push events and then generate GA pings based on those IDB entries whenever the site is loaded, e.g. here. But that will end up undercounting, since there's a percentage of users who would get a push event but never bother clicking through to the website, or who clickthrough the website after X number of days have passed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants