analytics-vue icon indicating copy to clipboard operation
analytics-vue copied to clipboard

Use VueRouter Lifecycle Hook for Page Calls Instead

Open dammyammy opened this issue 5 years ago • 0 comments

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.

dammyammy avatar Dec 22 '19 09:12 dammyammy