mpoehler / firebase-amp-pwa

sample project for amp landingpages and a VueJs app as a PWA using firebase
Apache License 2.0
0 stars 0 forks source link

Add Google Analytics tracking #22

Open mpoehler opened 5 years ago

mpoehler commented 5 years ago

With use of the Google Tag Manager and the offline capabilities of workbox.

mpoehler commented 5 years ago

In Google Tag Manager we need two different Containers. One normal Web and one AMP. But they share the analytics setting I guess. Maybe there is a way to make that somehow nice? And all settings like GA-TrackingIds should be injected using some kind of .env mechanism.

mpoehler commented 5 years ago

https://builtvisible.com/google-analytics-for-pwas-tracking-offline-behaviour-and-more/

mpoehler commented 5 years ago

We should start to think about the .env - we need to integrate the TrackingId during the AMP-Page generation process as well as in the VueJs app. In the VueJs app we should utilize the embedded .env support.

I would suggest to have the following environments:

When it comes to Google Analytics,

It is also important, that .env can be overwritten by variables set in the environment. This is important, because all settings in the CI-Build will be set with environment variables.

mpoehler commented 5 years ago

So next steps: