Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • improve posthog config to be more lightweight

Type of Change

  • Other: Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 16, 2026 4:31pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

Reduced PostHog's data collection footprint by disabling automatic tracking features and removing the autocapture configuration object.

Key Changes:

  • Disabled capture_pageview (was true) and autocapture (removed allowlist config)
  • Removed autocapture configuration object with dom_event_allowlist and element_allowlist
  • Moved property definitions for better organization

Impact:

  • PostHog will now only track user identification via posthog.identify() in session-provider
  • No automatic pageview, interaction, or navigation events will be captured
  • Significantly reduces data volume and processing overhead as intended

Confidence Score: 4/5

  • Safe to merge with minimal risk - configuration changes align with stated goal of lightweight analytics
  • The changes are straightforward configuration adjustments that disable automatic tracking features. Code analysis confirms no manual tracking exists that would be affected. The only active PostHog functionality will be user identification, which remains intact.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/_shell/providers/posthog-provider.tsx Disabled autocapture and pageview tracking to reduce data collection; only user identification remains active

Sequence Diagram

sequenceDiagram
    participant App
    participant PostHogProvider
    participant PostHog SDK
    participant SessionProvider
    participant User

    App->>PostHogProvider: Mount on app startup
    PostHogProvider->>PostHog SDK: init() with lightweight config
    Note over PostHog SDK: autocapture: false<br/>capture_pageview: false<br/>capture_pageleave: false<br/>capture_performance: false<br/>capture_dead_clicks: false<br/>enable_heatmaps: false
    PostHog SDK-->>PostHogProvider: Initialized (minimal tracking)
    
    User->>App: Navigates or interacts
    Note over PostHog SDK: No automatic events captured
    
    User->>App: Signs in
    App->>SessionProvider: Load session
    SessionProvider->>PostHog SDK: identify(userId, userProps)
    PostHog SDK-->>SessionProvider: User identified
    
    User->>App: Signs out
    App->>SessionProvider: Clear session
    SessionProvider->>PostHog SDK: reset()
    PostHog SDK-->>SessionProvider: User data cleared
Loading

@waleedlatif1 waleedlatif1 merged commit dba5799 into staging Jan 16, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/posthog branch January 16, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants