Skip to content

Commit

Permalink
feat: Add __posthog_debug query string (#1108)
Browse files Browse the repository at this point in the history
* Add __posthog_debug query string

* Add more defensiveness
  • Loading branch information
robbie-c authored Apr 3, 2024
1 parent 8619a3e commit 4bbf0cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
isCrossDomainCookie,
isDistinctIdStringLike,
} from './utils'
import { window, assignableWindow } from './utils/globals'
import { window, assignableWindow, location } from './utils/globals'
import { autocapture } from './autocapture'
import { PostHogFeatureFlags } from './posthog-featureflags'
import { PostHogPersistence } from './posthog-persistence'
Expand Down Expand Up @@ -124,7 +124,7 @@ export const defaultConfig = (): PostHogConfig => ({
save_referrer: true,
capture_pageview: true,
capture_pageleave: true, // We'll only capture pageleave events if capture_pageview is also true
debug: false,
debug: (location && _isString(location?.search) && location.search.indexOf('__posthog_debug=true') !== -1) || false,
verbose: false,
cookie_expiration: 365,
upgrade: false,
Expand Down

0 comments on commit 4bbf0cf

Please sign in to comment.