Measure PWA installs

How can I figure out how many users have installed the PWA version of the app?

Ideally i’d record it in google analytics, but storing it in tables would suffice too.

Do you mean installed as in added to home screen, as opposed to running in a browser?

I seem to recall that’s it’s possible to detect that with JavaScript, although I can’t find a reference right now. If you Google or search the Community you might find an example.

Yes, i’m talking about when an app is added to the home screen.

I know it’s possible to detect it with JavaScript, but it’s unclear how I can do that in Glide

This post says adding JS is impossible - How to Add CSS / Java Script in Glide app? - #2 by Jeff_Hager

Am I supposed to use a JS column in a table? Do I have access to Google Analytics SDK in JS columns?

That post is almost 2 years old. We didn’t have the JavaScript column back then.

Yes.
In fact, simply copy/pasting that code that you linked to seems to do the trick:

function getPWADisplayMode() {
  const isStandalone = window.matchMedia('(display-mode: standalone)').matches;
  if (document.referrer.startsWith('android-app://')) {
    return 'twa';
  } else if (navigator.standalone || isStandalone) {
    return 'standalone';
  }
  return 'browser';
}

return getPWADisplayMode();

Using the output of the above and displaying it in a hint component, I get:

  1. In the builder (Chrome on MacOS):

  1. When installed on the home screen on my phone (Safari on IOS):

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.