Skip to content

Commit 3959a4c

Browse files
committed
fix: missing url param on page view [internal]
1 parent f7000af commit 3959a4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/docusaurus-plugin-segment/segment.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ function getOneTrustConsentContext() {
2929
}
3030

3131
export default ExecutionEnvironment.canUseDOM ? {
32-
onRouteUpdate({ location }) {
32+
onRouteUpdate() {
3333
// Don't track page views on development
3434
if (process.env.NODE_ENV === 'production' && window.analytics) {
3535
window.analytics.page({
3636
app: 'docs',
3737
page_type: 'DOCS_PAGE',
38-
path: location.pathname,
39-
url: location.href,
40-
search: location.search,
38+
path: window.location.pathname,
39+
url: window.location.href,
40+
search: window.location.search,
4141
...getOneTrustConsentContext(),
4242
});
4343
}

0 commit comments

Comments
 (0)