5

How should I integrate analytics into a PWA webapp ? if I add analytics from google analytics into webapp and publish it in a server, then later, if I want to publish it on Google Play Store, how should I track the use?

here's the scenario:

  • I'm deploying the PWA from a subdomain.
  • then I'm publishing the PWA from Google Play Store as a TWA.

My concerns:

Should I use the google analytics snippet for web to track the subdomain-based pwa and firebase analytics for my Google Play Store app?

Or,

Can I use a single method to track both versions at the same time?

I have found this faq of chrome developer about use of google analytics

The CPA library follows the basic usage pattern of Google Analytics and will feel familiar to existing users of Google Analytics. However, unlike the web-centric official Google Analytics JavaScript libraries, the CPA library uses an "app-centric" model that is better suited for Packaged Apps. Among other features, the library provides methods for specific types of hits, such as "event" and "appView", and it can be used in both Closure-based and traditional JavaScript projects.

I am using Vuejs as frontend with pwa template, not sure if it is applicable for my use case. Any suggestion or direction would be much appreciated.

Rakibul Haq
  • 1,348
  • 23
  • 32

1 Answers1

1

I am using THIS - Web + App configuration.

Using this you can track both at the same time.

You can configure it easily in firebase - see HERE for more

Sean Dvir
  • 301
  • 4
  • 15
  • thank you for sharing the resource. I would go through it and let you know if it works in my case. thank you very much, – Rakibul Haq Apr 20 '20 at 16:09