-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (bd5a2b4) react-router/shopper #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The files don't exist locally, but I have the complete diff provided in the PR description. I'll evaluate the PR based on the comprehensive diff information provided, which shows the full content of all changed files. PR Evaluation ReportSummaryThis PR adds PostHog analytics integration to a React Router v7 e-commerce application ("shopper"). It includes client-side SDK initialization via
Confidence score: 4/5 👍
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | @posthog/react, posthog-js, posthog-node all added to package.json |
| PostHog client initialized | Yes | Client-side: posthog.init() in entry.client.tsx with PostHogProvider. Server-side: new PostHog() in middleware with withContext |
| capture() | Yes | Multiple capture calls across routes for cart, checkout, search, and navigation events |
| identify() | No | No posthog.identify() calls present. Users are not identified even when providing checkout form data |
| Error tracking | Yes | captureException(error) in ErrorBoundary component |
| Reverse proxy | Partial | Dev server proxy configured in vite.config.ts, but production deployment needs separate configuration |
Issues
- Missing user identification: No
posthog.identify()calls when users provide their name/email during checkout. This means all events are anonymous and can't be tied to specific users. Should callposthog?.identify(email, { name: formData.fullName })in the checkout flow. [MEDIUM] - Dev-only reverse proxy: The Vite server proxy at
/ingestonly works during development. Production deployments will hit CORS/adblock issues unless a production reverse proxy is configured (e.g., Vercel rewrites, nginx config). The client initialization should also updateapi_hostto use/ingestfor the proxy to work. [MEDIUM] - API host not using proxy: The
api_hostin entry.client.tsx is set toimport.meta.env.VITE_PUBLIC_POSTHOG_HOST(direct PostHog URL) instead of/ingestwhich would leverage the reverse proxy. [MEDIUM]
Other completed criteria
- API key via environment variable (not hardcoded)
- PostHogProvider wraps application correctly
- Server middleware uses context-based API correctly
- Session and distinct ID headers passed from client to server
- Proper shutdown in middleware with
.catch()for graceful handling
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
app/root.tsx |
captureException |
Captures errors from ErrorBoundary for exception monitoring |
app/routes/home.tsx |
cta_clicked |
Tracks homepage CTA engagement with location context |
app/routes/products.tsx |
product_added_to_cart, product_searched, category_filtered |
Tracks product listing interactions. Search event fires per keystroke (problematic). |
app/routes/products..tsx |
product_added_to_cart |
Tracks add to cart from detail page with quantity and source |
app/routes/cart.tsx |
product_removed_from_cart, cart_quantity_updated, checkout_started |
Comprehensive cart funnel tracking with item details |
app/routes/checkout.tsx |
order_placed |
Tracks completed orders with total, tax, and item breakdown |
Issues
- Search event over-firing:
product_searchedfires on every keystroke whenterm.length > 0. This will create excessive events and pollute analytics. Should debounce (300-500ms) or fire on form submission/blur. [MEDIUM] - Missing product view event: No
product_viewedevent when users visit the product detail page. This is a key funnel metric. [LOW] - Missing page view tracking: While PostHog auto-captures pageviews by default, explicit page tracking or
capture_pageviewconfig isn't mentioned. [LOW]
Other completed criteria
- Events represent real user actions (add to cart, checkout, order)
- Events include relevant properties (product_id, product_name, price, quantity)
- Source property distinguishes where actions originated (products_listing vs product_detail)
- Cart events include comprehensive item arrays for basket analysis
- Order events include subtotal, tax, and total for revenue tracking
- No PII in event properties (using product IDs, not raw user data)
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: manual
Trigger ID:
bd5a2b4App:
react-router/shopperApp directory:
apps/react-router/shopperWorkbench branch:
wizard-ci-bd5a2b4-react-router-shopperWizard branch:
mainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-21T21:07:01.831Z
Duration: 321.1s