:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import posthog from 'posthog-js'
import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedArea'
import { TeamMembershipLevel } from 'lib/constants'
import { TeamSettingToggle } from '../components/TeamSettingToggle'
export function DeadClicksAutocaptureSettings(): JSX.Element {
const restrictedReason = useRestrictedArea({
scope: RestrictionScope.Project,
minimumAccessLevel: TeamMembershipLevel.Admin,
})
return (
<TeamSettingToggle
field="capture_dead_clicks"
label="Enable dead clicks autocapture"
onChange={(checked) => posthog.capture('dead_clicks_autocapture_toggled', { isEnabled: checked })}
disabledReason={restrictedReason}
/>
)
}