Skip to content

Commit

Permalink
Add process_person init config option
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Apr 2, 2024
1 parent 174f83b commit ca24fc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const defaultConfig = (): PostHogConfig => ({
bootstrap: {},
disable_compression: false,
session_idle_timeout_seconds: 30 * 60, // 30 minutes
process_person: 'always',
})

class DeprecatedWebPerformanceObserver {
Expand Down
7 changes: 7 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ export interface PostHogConfig {
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[]

/** You can control whether events from PostHog-js have person processing enabled with the `process_person` config setting. There are three options:
* - `process_person: 'always'` _(default)_ - we will process persons data for all events
* - `process_person: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonyomous to identified. All events (including `$identify`) will be sent with `$process_person: False`.
* - `process_person: 'identified_only'` - we will only process persons when you call `posthog.identify([distinct_id])`. Anonymous users won't get person profiles.
*/
process_person?: 'always' | 'never' | 'identified_only'
}

export interface OptInOutCapturingOptions {
Expand Down

0 comments on commit ca24fc4

Please sign in to comment.