如何跟踪pwa的安装数量

我正在使用

 window.addEventListener('beforeinstallprompt', e => {
  e.userChoice.then(choiceResult => {
    ga('send', 'event', 'A2H', choiceResult.outcome);
    alert('AAAAAAAAAAAAAa',choiceResult.outcome)
  });
});

but this event not work with event default of pwa, only work with one button custom generating deferredPrompt.prompt(); what i can do?

评论