S
S
shaurmista2020-04-15 11:58:21
JavaScript
shaurmista, 2020-04-15 11:58:21

How to track PWA opening?

There is a PWA, and I need to understand when the user opens it (exactly from the phone screen already)
How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-04-15
@hzzzzl

I wanted to answer that when installing on the home screen, events occur
https://github.com/w3c/manifest/issues/699
but it turned out that there is now a simple media query for this, see
https://stackoverflow.com/a/51735941
(I haven't tried it so I don't know how it works)

if (window.matchMedia('(display-mode: standalone)').matches) {  
    // do things here  
    // set a variable to be used when calling something  
    // e.g. call Google Analytics to track standalone use   
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question