feat: Add tracking of PWA installs
This commit is contained in:
parent
38bd1d5585
commit
e085553306
|
@ -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);
|
||||
}
|
||||
|
|
Reference in New Issue