Skip to content

how to access umTrackView in middleware #57

Answered by ijkml
tasiotas asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @tasiotas.

umTrackView is already auto-imported, all you have to do is call it. Make sure to disable autoTrack first.

const excludedRoutes = [ 'dashboard' ]

export default defineNuxtRouteMiddleware((to, from) => {
  if (excludedRoutes.includes(to.name)) { return }
  umTrackView(to.href)
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ijkml
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #55 on April 19, 2023 16:52.