feat: Add tracking of PWA installs

This commit is contained in:
Tom Moor 2021-02-22 22:30:47 -08:00
parent 38bd1d5585
commit e085553306
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ export default class Analytics extends React.Component<Props> {
script.src = "https://www.google-analytics.com/analytics.js";
script.async = true;
// Track PWA install event
window.addEventListener("appinstalled", () => {
ga("send", "event", "pwa", "install");
});
if (document.body) {
document.body.appendChild(script);
}