Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 7453ace

Browse files
author
Matteo Gabriele
committed
feat(autotracking): add the transformRouteParams property
is now possible to avoid the autotracking to transform all route params into querystrings and add them to the tracked page data
1 parent 7e48f05 commit 7453ace

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const defaultConfig = {
1212
autoTracking: {
1313
exception: false,
1414
page: true,
15+
transformRouteParams: true,
1516
pageviewOnLoad: true,
1617
pageviewTemplate: null,
1718
untracked: true

src/lib/page.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { noop, getQueryString, isRouteIgnored } from '../helpers'
55

66
export default function page (...args) {
77
if (typeof args[0] !== 'string' && 'currentRoute' in args[0]) {
8+
const { transformRouteParams } = config.autoTracking
89
const route = args[0].currentRoute
910
const queryString = getQueryString(route.query)
10-
const path = route.path + queryString
11+
const path = route.path + (transformRouteParams ? queryString : '')
1112

1213
set('page', path)
1314
query('send', 'pageview', {

0 commit comments

Comments
 (0)