Closed marchantweb closed 10 months ago
Great idea! PR happily welcome. 🙂
I'm not sure if a Nuxt hook is the best choice of just using the useRouter().afterEach
method. Maybe you can look into that. Thanks in advance.
Dito, happy New Year to you too.
Isn’t page tracking done by default already with the default setup (before this PR?)
@notflip Correct. See the PR discussion: https://github.com/johannschopplich/nuxt-gtag/pull/38#issuecomment-1874356691
Closing this for now, since enhanced management will already watch for history state changes, which should cover most use cases. Kudos to @marchantweb for the PR tho!
Describe the feature
Hey!
Are you open to the idea of calling
useTrackEvent('page_view')
(perhaps with route metadata) automatically on route change?I'm thinking it's optional, disabled by default but you can opt-in via
nuxt.config
. This would have the module act a little more like a typical GA site tracker, where every page view is tracked automatically.If this makes sense for the module, I can submit a PR. Thoughts?
P.S. Happy New Year
Additional information
Final checks