-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
complexity: moderateTime needed to do this ticket will be moderate e.g. 1-2 daysTime needed to do this ticket will be moderate e.g. 1-2 daysfeature/enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededpriority: soonShould be prioritized soon.Should be prioritized soon.staleThis issue or PR is inactiveThis issue or PR is inactiveweb-development
Milestone
Description
Overview
This task is related to PWA epic #1197 . This task involves adding analytics events to be triggered on each app load, sending either WEB_APP_LOADED
or PWA_LOADED
depending on whether the user is using a PWA or normal web app.
Action Items
- Add logic to determine if the user is using a PWA or web app - see resources below
- Send analytics events on app load,
WEB_APP_LOADED
orPWA_LOADED
using our existinglogEvent()
function - see more about our events in Add PWA analytics events #1208. Include theeventUserData
params and an additionalbrowser
param with the event, i.e.logEvent(PWA_LOADED, eventUserData)
Resources/Instructions
To test that analytics events are being triggered, check the console log where events should be shown.
Note these resources are guides to general pwa/browser detection, but there may be a better solution for next.js or next-pwa
https://web.dev/learn/pwa/detection
https://stackoverflow.com/questions/41742390/javascript-to-check-if-pwa-or-mobile-web
const isInStandaloneMode = () =>
(window.matchMedia('(display-mode: standalone)').matches) || (window.navigator.standalone) || document.referrer.includes('android-app://');
if (isInStandaloneMode()) {
console.log("webapp is installed")
}
Metadata
Metadata
Assignees
Labels
complexity: moderateTime needed to do this ticket will be moderate e.g. 1-2 daysTime needed to do this ticket will be moderate e.g. 1-2 daysfeature/enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededpriority: soonShould be prioritized soon.Should be prioritized soon.staleThis issue or PR is inactiveThis issue or PR is inactiveweb-development