Add PostHog Analytics and Event Tracking#705
Open
AshutoshDash1999 wants to merge 3 commits into
Open
Conversation
…, leaderboard views, and maintainer invites
…ng for landing page views
Contributor
|
@AshutoshDash1999 is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
jakharmonika364
requested changes
Jul 14, 2026
| "img-src 'self' data: https: blob:", | ||
| "font-src 'self' data:", | ||
| `connect-src 'self' https://api.github.com https://github.com https://*.supabase.co https://vitals.vercel-insights.com${isDev ? " http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*" : ""}`, | ||
| `connect-src 'self' https://api.github.com https://github.com https://*.supabase.co https://vitals.vercel-insights.com https://us.i.posthog.com https://us-assets.i.posthog.com${isDev ? " http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*" : ""}`, |
Collaborator
There was a problem hiding this comment.
defaults: '2026-05-30' turns on autocapture + pageview tracking for every visitor by default, not just the events you added. we don't disclose any analytics in /privacy right now. either turn autocapture/pageview off and keep just the manual events, or update the privacy page first.
also the ! on NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN will run this unconditionally even when the token's unset (which is the .env.example default), guard it with an if.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Related Issue
Closes #388
What was changed?
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOSTto.env.examplefor PostHog analytics configuration.instrumentation-client.tsto initialize PostHog tracking.next.config.jsto include PostHog tracking URLs in the CSP.posthog-jstopackage.jsondependencies.core-jsanddompurifytopackage-lock.json.query-selector-shadow-domandweb-vitalstopackage-lock.json.rec-cards.tsx,verify-button.tsx,leaderboard-content.tsx,invite-contributor-button.tsx, andLandingPage.tsxto capture events using PostHog.events.tsandhelpers.tsfor PostHog event definitions and helper functions.Screenshots
Checklist
npm run dev)