Detect that a PWA has been launched from Microsoft Store

Ben 6 Reputation points
2020-12-24T09:45:36.317+00:00

I built a PWA and integrated it in the Microsoft Store (https://www.microsoft.com/store/productId/9P82T7LD9LCK). Now I would like to customize some of its functionalities for MS Store but first I need to detect (in javascript or CSS) that the app has been launched from MS Store (as opposed to launched from a web browser). Can you help me with this?

I also would like to track the app using Google Analytics and for that I need to pass one or several "utm" arguments in the start url. Since I used PWAbuilder.com to build the app packages, I tried to fill the "URL" field of the "Windows Package Options" with the following value: "https://base.finance?utm_source=microsoft_store". However, it does not seem to work: when I open the app from the MS Store, the start url is just "https://base.finance". What else can I do?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,577 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Jussi Palo 6 Reputation points
    2021-05-05T15:04:11.79+00:00

    Does anyone have any answer to this? My app is pending because I'd need a way to hide links to other Stores but only when running in MS Store PWA.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.