Skip to content

Commit

Permalink
fix url tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed Sep 27, 2024
1 parent c465139 commit b305252
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/packages/analytics/src/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe("Analytics", () => {
// segment should be called with context.page.url = undefined
expect(mockSegment.track).toHaveBeenCalledWith("custom_event", undefined, {
context: {
page: { url: undefined },
page: { url: null, path: null, title: null },
},
});
});
Expand Down Expand Up @@ -208,7 +208,7 @@ describe("Analytics", () => {
version: "1.0.0",
});
});

describe("analytics.page()", () => {
it("should call segment.page()", () => {
analytics = new Analytics();
Expand Down
2 changes: 1 addition & 1 deletion app/packages/analytics/src/usingAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Analytics {
if (!this._segment) return;
let opts;
if (this._disableUrlTracking) {
opts = { context: { page: { url: undefined } } };
opts = { context: { page: { url: null, path: null, title: null } } };
}
if (this._version) {
opts = { ...opts, version: this._version };
Expand Down

0 comments on commit b305252

Please sign in to comment.