Tracking homescreen installs
Once the homescreen install prompt displays, the user can choose to add the PWA to their homescreen, or ignore the prompt. Businesses should track and measure everything possible to make better decisions. Knowing how many homescreen installs there have been and what rate customers install their PWA provides insight into their marketing and technology investments.
Chrome supports the beforeinstallprompt
event, which can be used to track this activity. You can add a handler to this event and log each user's choice:
window.addEventListener('beforeinstallprompt', function(event) { event.userChoice.then(function(result) { if(result.outcome == 'dismissed') { // They dismissed, send to analytics }else { // User accepted! Send to analytics } }); });
You can POST the user's choice to your analytics system. This could be a custom API to your internal analytics or even tied to your third...