analytics-vue
analytics-vue copied to clipboard
Use VueRouter Lifecycle Hook for Page Calls Instead
I Propose Automatically Setting Page using VueRouter Lifecycle Hook as an alternative. This is cleaner, in my opinion, and also reduces having to rewrite it on each page component.
Instead of having to call analytics.page on every single page, it becomes tiring a the number of pages grows, a more streamlined approach would be to call page automatically as the original javascript embed does use the afterEach Hook in VueRouter, and then doing the necessary track, identify etc calls within each Page component.
It Mimmicks the default javascript code behaviour as intended by the segment tracking code in SPAs.