Skip to content

Commit

Permalink
feat(page-tracker): add fullPath option
Browse files Browse the repository at this point in the history
closes #229
  • Loading branch information
MatteoGabriele committed Apr 11, 2021
1 parent 2468661 commit 1325a2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions __tests__/__snapshots__/install.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ Object {
"pageTrackerScreenviewEnabled": false,
"pageTrackerSkipSamePath": true,
"pageTrackerTemplate": [Function],
"pageTrackerUseFullPath": false,
}
`;
1 change: 1 addition & 0 deletions src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export let options = {
bootstrap: true,
globalObjectName: "gtag",
globalDataLayerName: "dataLayer",
pageTrackerUseFullPath: false,
pageTrackerEnabled: true,
pageTrackerScreenviewEnabled: false,
pageTrackerSkipSamePath: true,
Expand Down
3 changes: 2 additions & 1 deletion src/page-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const getPageviewTemplate = (to = {}, from = {}) => {
const {
pageTrackerTemplate,
pageTrackerScreenviewEnabled,
pageTrackerUseFullPath,
appName,
} = getOptions();

Expand All @@ -24,7 +25,7 @@ export const getPageviewTemplate = (to = {}, from = {}) => {
} else {
template = {
page_title: to.name,
page_path: to.path,
page_path: pageTrackerUseFullPath ? to.fullPath : to.path,
page_location: window.location.href,
};
}
Expand Down

0 comments on commit 1325a2c

Please sign in to comment.