Skip to content

Commit

Permalink
Enable scroll stats by default
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Jan 15, 2024
1 parent 70c2167 commit 32a4e8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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<string, any> = {}
if (event_name === '$pageview') {
performanceProperties = this.pageViewManager.doPageView()
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export interface PostHogConfig {
featureFlagPayloads?: Record<string, JsonType>
}
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[]
}
Expand Down

0 comments on commit 32a4e8e

Please sign in to comment.