Skip to content

Commit

Permalink
feat: add location.search to default event path
Browse files Browse the repository at this point in the history
Have default path include `location.search` as part of passing path belonging to events.

PR: #243
  • Loading branch information
jbergstroem authored Apr 11, 2024
1 parent b0aedfc commit 63ad5a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function getPage(): string {
const hash = location.hash;
// This is to support HashRouter from either ReactRouter or VueRouter.
if (hash[1] === "/") return hash;
return location.pathname;
return `${location.pathname}${location.search}`;
}

function getEvent(type: EventType, node: HTMLElement): ProductEvent {
Expand Down

0 comments on commit 63ad5a8

Please sign in to comment.