Skip to content

Scheduling infrastructure for absolutely everyone.

fix: #17602 (#17604)

Ankit Yadav0da3a9fa119f
diff --git a/packages/features/ee/event-tracking/lib/posthog/web/PostHogPageView.tsx b/packages/features/ee/event-tracking/lib/posthog/web/PostHogPageView.tsx
index 9bf99fcf733..7f26edfd668 100644
--- a/packages/features/ee/event-tracking/lib/posthog/web/PostHogPageView.tsx
+++ b/packages/features/ee/event-tracking/lib/posthog/web/PostHogPageView.tsx
@@ -12,7 +12,7 @@ export default function PostHogPageView() {
// Track pageviews
if (pathname && posthog) {
let url = window.origin + pathname;
- if (searchParams.toString()) {
+ if (searchParams?.toString()) {
url = `${url}?${searchParams.toString()}`;
}
posthog.capture("$pageview", {