# Measure PWA installs

**URL:** <https://community.glideapps.com/t/measure-pwa-installs/58073>\
**Category:** Ask for Help\
**Created:** [February 17, 2023, 11:22am UTC](https://community.glideapps.com/t/measure-pwa-installs/58073 "2023-02-17T11:22:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boris](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/boris/32/53638_2.png) [@Boris](https://community.glideapps.com/u/Boris)\
**Post date:** [February 17, 2023, 11:22am UTC](https://community.glideapps.com/t/measure-pwa-installs/58073/1 "2023-02-17T11:22:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 17, 2023, 11:28am UTC](https://community.glideapps.com/t/measure-pwa-installs/58073/2 "2023-02-17T11:28:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Boris](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/boris/32/53638_2.png) [@Boris](https://community.glideapps.com/u/Boris)\
**Post date:** [February 17, 2023, 11:59am UTC](https://community.glideapps.com/t/measure-pwa-installs/58073/3 "2023-02-17T11:59:03Z")

</div>

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

I know it’s possible to [detect it with JavaScript,](https://petelepage.com/blog/2019/07/is-my-pwa-installed/#:~:text=First%2C%20you%20can%20use%20the,CSS%20display%20mode%20is%20standalone%20.) 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](https://community.glideapps.com/t/how-to-add-css-java-script-in-glide-app/28726/2)

Am I supposed to use a [JS column](https://www.glideapps.com/plugins/hell-yes-code) in a table? Do I have access to Google Analytics SDK in JS columns?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 17, 2023, 12:12pm UTC](https://community.glideapps.com/t/measure-pwa-installs/58073/4 "2023-02-17T12:12:00Z")

</div>

> [@Boris](#):
>
> This post says adding JS is impossible - [How to Add CSS / Java Script in Glide app? - #2 by Jeff\_Hager](https://community.glideapps.com/t/how-to-add-css-java-script-in-glide-app/28726/2)

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

> [@Boris](#):
>
> Am I supposed to use a [JS column](https://www.glideapps.com/plugins/hell-yes-code) in a table?

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

```auto
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();

```

 ![CleanShot 2023-02-17 at 20.07.35@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/9/79f9468e9dc197a323ad2c51af31b30fe04c8a72.png)

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

1. In the builder (Chrome on MacOS):

 ![CleanShot 2023-02-17 at 20.07.08@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/8/28a359ab6c656d9961b73515babcf4ced1588be7.png)

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

 ![CleanShot 2023-02-17 at 20.08.11@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/f/6fa3104bbb666270d334b84f49a4a06ee5707d0f.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 18, 2023, 12:12pm UTC](https://community.glideapps.com/t/measure-pwa-installs/58073/5 "2023-02-18T12:12:07Z")

</div>

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