Skip to content

[CI] (4c70a79) astro/astro-view-transitions-marketing - #3849

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

[CI] (4c70a79) astro/astro-view-transitions-marketing#3849
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-4c70a79-astro-astro-view-transitions-marketing

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 4c70a79
App: astro/astro-view-transitions-marketing
App directory: apps/astro/astro-view-transitions-marketing
Workbench branch: wizard-ci-4c70a79-astro-astro-view-transitions-marketing
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-09T22:10:50.073Z
Duration: 273.3s

YARA Scanner

✓ 128 tool calls scanned, 0 violations detected

No violations: ✓ 128 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Astro marketing site with view transitions. It adds the PostHog JS snippet via a reusable posthog.astro component included in the layout, with inline onclick event captures on CTA buttons across home, pricing, and navigation pages.

Files changed Lines added Lines removed
7 +42 -7

Confidence score: 4/5 👍

  • Missing view transitions guard: The app uses <ViewTransitions /> but the PostHog component lacks the window.__posthog_initialized guard, which can cause re-initialization and stack overflow errors during client-side navigation. [CRITICAL]
  • No reverse proxy configured: The api_host points directly to the PostHog host with no reverse proxy or rewrite, making client-side events susceptible to ad blockers. [MEDIUM]
  • No identify() implementation: No user identification is set up anywhere in the app. While this is a marketing site, there's no guidance or placeholder for identifying users. [MEDIUM]

File changes

Filename Score Description
src/components/posthog.astro 3/5 PostHog snippet component with env var validation and error tracking config, but missing view transitions guard
src/layouts/Layout.astro 5/5 Correctly imports and places PostHog component in <head>
src/pages/index.astro 4/5 Adds inline capture events on hero CTAs
src/pages/pricing.astro 4/5 Adds inline capture events on pricing plan CTAs
src/components/Navigation.astro 4/5 Adds inline capture event on nav CTA
package.json 5/5 Adds posthog-js dependency
.env.example 4/5 Documents env vars with PUBLIC_ prefix

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Valid Astro component structure, correct is:inline usage
Preserves existing env vars & configs Yes No existing configs modified destructively
No syntax or type errors Yes All inline JS and Astro syntax is valid
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

  • Missing ViewTransitions re-initialization guard: The app uses <ViewTransitions /> from astro:transitions, which causes client-side navigation that can re-execute inline scripts. The PostHog docs explicitly recommend wrapping the snippet with if (!window.__posthog_initialized) to prevent stack overflow errors. This guard is missing. [CRITICAL]

Other completed criteria

  • Environment variables documented in .env.example with correct PUBLIC_ prefix for Astro
  • posthog-js added to package.json dependencies
  • Build configuration remains valid

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes Both posthog-js in package.json and HTML snippet in posthog.astro (redundant but not broken)
PostHog client initialized Yes Snippet initializes via window.posthog.init() with env vars and is:inline directive
capture() Yes 6 meaningful capture calls via inline onclick handlers
identify() No No identify implementation anywhere in the app
Error tracking Yes capture_exceptions configured with capture_unhandled_errors: true and capture_unhandled_rejections: true
Reverse proxy No api_host points directly to PostHog host, no proxy configured

Issues

  • Missing ViewTransitions initialization guard: Per PostHog's Astro docs, when using <ClientRouter> / <ViewTransitions>, the snippet must be wrapped in if (!window.__posthog_initialized) and should set capture_pageview: 'history_change'. Without this, PostHog will be re-initialized on every soft navigation, potentially causing stack overflows and duplicate pageview events. [CRITICAL]
  • No reverse proxy: Client-side events sent directly to PostHog host will be blocked by ad blockers. A reverse proxy should be configured. [MEDIUM]
  • No identify() call: No user identification is implemented. While this is a static marketing site with limited auth, the integration should at minimum document how to add identification. [MEDIUM]
  • Redundant posthog-js in package.json: The snippet approach loads PostHog from the CDN, so the posthog-js npm package in package.json is unused. Not harmful but unnecessary. [LOW]
  • defaults date is outdated: Uses '2026-01-30' instead of the latest '2026-05-30' documented in PostHog docs. [LOW]

Other completed criteria

  • API key loaded from environment variable (PUBLIC_POSTHOG_PROJECT_TOKEN)
  • Host correctly loaded from environment variable (PUBLIC_POSTHOG_HOST)
  • Uses is:inline directive as required for Astro
  • PostHog component placed in Layout for all pages
  • Development-mode error thrown for missing env vars
  • tracing_headers configured with window.location.hostname

PostHog insights and events ✅

Filename PostHog events Description
posthog.astro captureException (auto) Automatic error tracking for unhandled errors and rejections
index.astro trial_cta_clicked, documentation_cta_clicked Tracks hero section CTA engagement with location property
pricing.astro pricing_plan_cta_clicked Tracks pricing plan selection with plan and cta_label properties
Navigation.astro navigation_get_started_clicked Tracks nav bar CTA click with location property

Issues

None — events are well-structured for this use case.

Other completed criteria

  • Events represent real user actions (CTA clicks on marketing pages)
  • Events enable product insights (can build conversion funnels: page view → CTA click → trial signup)
  • Events include contextual properties (cta_location, plan, cta_label)
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case naming

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