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

onBeforeTrack handler returning false cancels tracking #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martsyn
Copy link

@martsyn martsyn commented Mar 12, 2024

pageTrackerExcludedRoutes array is insufficient for large lists of routes. A custom logic is needed to be able to filter out the pages with no tracking, e.g.:

app.use(
  VueGtag,
  {
    id: measurementId,
    onBeforeTrack: to => !to.meta?.hidden,
  },
  router,
)

@martsyn
Copy link
Author

martsyn commented Mar 12, 2024

I can offer two alternatives:

a) Make pageTrackerExcludedRoutes optionally a function
b) add explicit function isRouteExcluded to options

Please let me know if either of these is preferred instead of this PR.

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.

None yet

1 participant