Closed metalanti closed 6 years ago
Hi @metalanti You cannot trigger any Google Analytics events if the client is not ready. You still need to wait for javascript to kick in, then you can interact with it and send events.
Can you give me an example for that wait? I am new with nuxt
in SSR applications you have 2 phases: the server-rendered page kicks in first, so you have that quick render of your page that makes SSR so useful ( plus SEO and other advantages ), after that phase is completed, javascript kicks in ( when fully loaded ) and so you have access to the window object, the document objects, you can do fancy animations with TweenMax and so on. (just to make few examples)
Google Analytics needs that second face to work, but you don't have to do anything: just follow the vue-analytics documentation and you should be good to go.
https://matteogabriele.gitbooks.io/vue-analytics/content
I hope I explained it decently
OK, thank you very much I need to read the docs :D
Yeah that's always good practice :)
Is there no plan on supporting enabling this module in SSR like GTM? https://github.com/nuxt-community/gtm-module/issues/7
Is there any way I would be able to help?
can I use this module during SSR? how can I trigger GA events from the server side? eg: set the userId, or addImpression for ecommerce on a list of products. or where should I take those codes? :) thanks