Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VueRouter Lifecycle Hook for Page Calls Instead #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dammyammy
Copy link

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.

Automatically Set Page using VueRouter Lifecycle Hook. 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.
This Call is redundant as the page is being set by VueRouter.
This Call is redundant as the page is being set by VueRouter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant