Repository navigation
[CI] (137243f) astro/astro-hybrid-marketing - #1960
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into an Astro hybrid marketing site (NeuralFlow AI) using both a client-side HTML snippet (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; Astro is:inline scripts and define:vars are correctly used |
| Preserves existing env vars & configs | Yes | Existing code and configs preserved; only PostHog additions made |
| No syntax or type errors | Yes | All TypeScript and Astro syntax is valid |
| Correct imports/exports | Yes | posthog-node imported correctly server-side; client uses HTML snippet |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues observed |
Issues
- No
.env.examplefor environment variables:PUBLIC_POSTHOG_PROJECT_TOKENandPUBLIC_POSTHOG_HOSTare added to.env(gitignored) but no.env.exampleor similar documentation is committed. Collaborators won't know which variables are required. Add a.env.examplewith placeholder values. [MEDIUM]
Other completed criteria
- Build configuration is valid —
posthog-nodeadded correctly topackage.jsondependencies .envcorrectly added to.gitignore- All imports resolve to correct packages
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-node v5.38.0 in package.json; client-side uses HTML snippet (no posthog-js package needed) |
| PostHog client initialized | Yes | Client: HTML snippet in posthog.astro with is:inline and define:vars for env injection, rendered in Layout <head>. Server: singleton pattern in posthog-server.ts |
| capture() | Yes | 10 meaningful events across 5 files covering CTAs, pricing, and contact form flows |
| identify() | No | Uses raw email as distinct_id on both client (posthog.identify(data.email, ...)) and server (distinctId: data.email), causing fragmented user profiles |
| Error tracking | Yes | captureException(error) called on client-side network errors in contact form |
| Reverse proxy | No | No reverse proxy configured; client snippet sends directly to PostHog host |
Issues
- Email used as
distinct_idfragments user data: Incontact.astro,window.posthog?.identify(data.email, ...)uses the email as the distinct ID. Inapi/contact.ts,posthog.identify({ distinctId: data.email })andposthog.capture({ distinctId: data.email, event: 'contact_form_received' })also use email. The server already receivesX-PostHog-Distinct-Idfrom the client but ignores it for identify and successful form capture. This creates separate person profiles for the anonymous browser session and the email-based server events. The server should usedistinctIdfrom the header and callidentifyto link that ID to the email. The client should not use email as the first argument toidentify. [CRITICAL] - No reverse proxy: Events from the browser go directly to the PostHog host, making them susceptible to ad blockers. Configure a reverse proxy (e.g., Astro middleware, Vercel rewrites, or PostHog's managed proxy). [MEDIUM]
- Older snippet version: The snippet uses
s.api_host+"/static/array.js"instead of the currents.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js". This means assets load from the API host rather than the optimized assets domain. [LOW]
Other completed criteria
- API key loaded from environment variable (
PUBLIC_POSTHOG_PROJECT_TOKEN) viaimport.meta.env - API host configured from environment variable (
PUBLIC_POSTHOG_HOST) viaimport.meta.env - PostHog component correctly uses
is:inlinedirective per Astro framework rules - PostHog component imported in Layout and wraps all pages
- Server-side client includes proper shutdown helper
defaults: '2026-01-30'set in client init
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
src/pages/index.astro |
free_trial_clicked, contact_sales_clicked |
Hero section CTA click tracking with location: 'hero' property |
src/components/Navigation.astro |
get_started_clicked |
Nav CTA click tracking with location: 'navigation' property |
src/pages/pricing.astro |
pricing_page_viewed, pricing_plan_clicked |
Page view on load and plan-specific CTA clicks with plan property (starter/pro/enterprise) |
src/pages/contact.astro |
contact_form_submitted, contact_form_error, captureException |
Form success/error tracking with interest and company properties; exception capture on network errors |
src/pages/api/contact.ts |
contact_form_received, contact_form_validation_failed, contact_form_server_error |
Server-side form processing events with validation reason and error details |
Issues
- Server-side capture uses email as
distinctId: Thecontact_form_receivedevent usesdata.emailasdistinctIdinstead of the client's distinct ID passed viaX-PostHog-Distinct-Idheader. This breaks the ability to build a proper funnel from client-side to server-side events since they'll be attributed to different persons. [CRITICAL]
Other completed criteria
- Events represent real user actions (CTA clicks, form submissions, page views)
- Events enable product insights — can build conversion funnel:
pricing_page_viewed→pricing_plan_clicked→contact_form_submitted→contact_form_received - Events include relevant contextual properties (
plan,location,interest,has_company,reason) - No PII in event properties — email/name only used in
identify()person properties - Event names are descriptive and follow consistent
snake_caseconvention
Reviewed by wizard workbench PR evaluator
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.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
137243fApp:
astro/astro-hybrid-marketingApp directory:
apps/astro/astro-hybrid-marketingWorkbench branch:
wizard-ci-137243f-astro-astro-hybrid-marketingWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-06-18T16:11:30.437Z
Duration: 390.1s