From 32a4e8e9a79da81fd13616b029a5e87ca40e0039 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Mon, 15 Jan 2024 15:03:03 +0000 Subject: [PATCH] Enable scroll stats by default --- src/posthog-core.ts | 4 ++-- src/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/posthog-core.ts b/src/posthog-core.ts index 948be0c46..2a99c13c8 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -213,7 +213,7 @@ const create_phlib = function ( instance.sessionRecording = new SessionRecording(instance) instance.sessionRecording.startRecordingIfEnabled() - if (instance.config.__preview_measure_pageview_stats) { + if (!instance.config.disable_scroll_properties) { instance.pageViewManager.startMeasuringScrollPosition() } @@ -966,7 +966,7 @@ export class PostHog { properties = _extend(properties, sessionProps) } - if (this.config.__preview_measure_pageview_stats) { + if (!this.config.disable_scroll_properties) { let performanceProperties: Record = {} if (event_name === '$pageview') { performanceProperties = this.pageViewManager.doPageView() diff --git a/src/types.ts b/src/types.ts index 3dde979d4..6a43151e1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -126,8 +126,8 @@ export interface PostHogConfig { featureFlagPayloads?: Record } segment?: any - __preview_measure_pageview_stats?: boolean __preview_send_client_session_params?: boolean + disable_scroll_properties?: boolean // Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` scroll_root_selector?: string | string[] }