This repository was archived by the owner on Mar 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Vue.use(VueAnalytics, {
2121})
2222```
2323
24- ### Manual page tracking
24+ ### Manual page tracking
2525
2626The standard way is just passing the current page path
2727
@@ -101,12 +101,13 @@ Vue.use(VueAnalytics, {
101101
102102### Ignore routes on page auto tracking
103103
104- To disable auto tracking for specific routes, you need to pass an array of names of routes to the plugin options
104+ To disable auto tracking for specific routes, you need to pass an array of strings to the plugin options.
105+ The string needs to be the route ` name ` or the route ` path ` .
105106
106107``` js
107108Vue .use (VueAnalytics, {
108109 router,
109- ignoreRoutes: [' home' , ' contacts' ]
110+ ignoreRoutes: [' home' , ' / contacts' ]
110111})
111112```
112113
Original file line number Diff line number Diff line change @@ -92,8 +92,10 @@ export function getQueryString (queryMap) {
9292 return queryString !== '' ? `?${ queryString } ` : ''
9393}
9494
95- export function isRouteIgnored ( name ) {
96- return config . ignoreRoutes . indexOf ( name ) !== - 1
95+ export function isRouteIgnored ( { name, path } ) {
96+ return [ name , path ]
97+ . filter ( Boolean )
98+ . find ( value => config . ignoreRoutes . indexOf ( value ) !== - 1 )
9799}
98100
99101export function isRoute ( data ) {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default function page (...args) {
3535}
3636
3737export function trackRoute ( route ) {
38- if ( isRouteIgnored ( route . name ) ) {
38+ if ( isRouteIgnored ( route ) ) {
3939 return
4040 }
4141
You can’t perform that action at this time.
0 commit comments