Skip to content

[CI] (22322bc) astro/astro-view-transitions-marketing - #3629

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-astro-astro-view-transitions-marketing
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-astro-astro-view-transitions-marketing

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 22322bc
App: astro/astro-view-transitions-marketing
App directory: apps/astro/astro-view-transitions-marketing
Workbench branch: wizard-ci-22322bc-astro-astro-view-transitions-marketing
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-08-28T19:09:21.068Z
Duration: 266.1s

YARA Scanner

✓ 118 tool calls scanned, 0 violations detected

No violations: ✓ 118 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Astro marketing site with view transitions (ClientRouter). It adds the PostHog JS snippet via a reusable posthog.astro component included in the Layout, captures custom events on the homepage, navigation, and pricing pages, and documents environment variables in .env.example.

Files changed Lines added Lines removed
7 +80 -1

Confidence score: 5/5 🧙

  • Missing is:inline initialization guard: The posthog.astro component uses define:vars but lacks the window.__posthog_initialized guard documented for Astro view transitions apps. With <ViewTransitions /> active, soft navigation re-executes inline scripts, which can cause PostHog to reinitialize on every page transition. The window.posthog?.__SV check only prevents re-running the snippet stub, not posthog.init() itself after the full SDK loads. [MEDIUM]
  • No reverse proxy configured: posthog-js in the browser benefits from a reverse proxy to avoid ad-blocker interception. None is set up. [MEDIUM]
  • No identify() call: There is no posthog.identify() anywhere. For a marketing site with no auth this is understandable, but the app has a "Get Started" / "Free Trial" flow where identification would be valuable. [MEDIUM]
  • posthog-js added to package.json but snippet is used: The snippet in posthog.astro loads PostHog via api_host + "/static/array.js", so the posthog-js npm dependency is unused and unnecessary. [LOW]

File changes

Filename Score Description
.env.example 4/5 Documents PUBLIC_POSTHOG_PROJECT_TOKEN and PUBLIC_POSTHOG_HOST with correct Astro PUBLIC_ prefix
package.json 3/5 Adds posthog-js dependency, but it's unused since the snippet approach is used
src/components/posthog.astro 3/5 PostHog snippet with is:inline, env var validation, error tracking config. Missing full initialization guard for view transitions
src/layouts/Layout.astro 5/5 Correctly imports and places PostHog component in <head>
src/components/Navigation.astro 4/5 Captures get_started_clicked with placement property
src/pages/index.astro 4/5 Captures free_trial_started from hero CTA
src/pages/pricing.astro 4/5 Captures events for all three pricing tiers with plan properties

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors; snippet and inline scripts are valid
Preserves existing env vars & configs Yes Only additive changes to existing files
No syntax or type errors Yes All is:inline scripts are valid JS
Correct imports/exports Yes PostHog component correctly imported in Layout
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None —

Issues

  • Unused posthog-js npm dependency: The posthog-js package is added to package.json but the integration uses the HTML snippet approach which loads the SDK from PostHog's CDN. The npm package is never imported. This adds unnecessary weight to node_modules. Remove it from package.json or switch to the npm import approach. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration remains valid

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes HTML snippet loads PostHog from CDN — valid alternative to npm package
PostHog client initialized Yes posthog.init() called with API key and host from env vars, with capture_pageview: 'history_change' for view transitions
capture() Yes Multiple meaningful capture calls across 3 pages
identify() No No identify call present; marketing site with CTA flows would benefit from identification
Error tracking Yes capture_exceptions configured with capture_unhandled_errors: true and capture_unhandled_rejections: true
Reverse proxy No No reverse proxy configured; browser SDK would benefit from one

Issues

  • Missing initialization guard for view transitions: The Astro docs explicitly recommend wrapping the snippet with if (!window.__posthog_initialized) when using <ViewTransitions /> / <ClientRouter>. Without it, posthog.init() may be called multiple times during soft navigation. The window.posthog?.__SV check prevents re-executing the snippet stub but does not prevent posthog.init() from running again after the full SDK has loaded. Add the __posthog_initialized guard. [MEDIUM]
  • No reverse proxy: Ad blockers can intercept PostHog requests. A reverse proxy is recommended for client-side tracking reliability. [MEDIUM]
  • No identify() call: No user identification is implemented. While this is a marketing site, the CTA flows (free trial, get started) suggest user interaction points where identification could be added. [MEDIUM]
  • defaults value is outdated: The defaults option is set to '2026-01-30' but the latest available is '2026-05-30'. This may cause the SDK to use older default behaviors. [LOW]

Other completed criteria

  • API key loaded from PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host correctly configured from PUBLIC_POSTHOG_HOST environment variable
  • capture_pageview: 'history_change' correctly set for view transitions
  • is:inline directive used on all script tags as required by Astro

PostHog insights and events ✅

Filename PostHog events Description
posthog.astro captureException (automatic) Unhandled errors and rejections captured automatically
Navigation.astro get_started_clicked Tracks CTA click in navigation with placement property
index.astro free_trial_started Tracks hero CTA click with placement property
pricing.astro get_started_clicked, free_trial_started, sales_contact_clicked Tracks all three pricing tier CTAs with placement and plan properties

Issues

  • No critical issues with event quality.

Other completed criteria

  • Events represent real user actions (CTA clicks across the marketing funnel)
  • Events enable product insights (funnel from homepage → pricing → signup/contact)
  • Events include relevant properties (placement, plan)
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case convention

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants