Skip to content

[CI] (3f7863c) astro/astro-view-transitions-marketing - #2386

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

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

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f7863c
App: astro/astro-view-transitions-marketing
App directory: apps/astro/astro-view-transitions-marketing
Workbench branch: wizard-ci-3f7863c-astro-astro-view-transitions-marketing
Wizard branch: posthog-code/pi-telemetry-parity
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-03T14:08:27.082Z
Duration: 438.0s

YARA Scanner

✓ 48 tool calls scanned, 0 violations detected

No violations: ✓ 48 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Astro marketing site with View Transitions (ClientRouter) support. It adds a posthog.astro initialization component using the HTML snippet approach with an initialization guard to prevent stack overflow during soft navigation, and instruments 10 custom events across pages and components covering CTA clicks, page views, footer links, and docs section clicks.

Files changed Lines added Lines removed
11 +204 -19

Confidence score: 4/5 👍

  • Duplicate page view events on initial load: features_page_viewed and pricing_page_viewed fire twice on initial page load because both DOMContentLoaded and astro:page-load trigger the setup function which calls capture() directly. [MEDIUM]
  • No error tracking configured: No captureException or exception autocapture setup. [MEDIUM]
  • No reverse proxy configured: Client-side PostHog is vulnerable to ad blockers without a reverse proxy. [MEDIUM]
  • No .env.example committed: Environment variables PUBLIC_POSTHOG_PROJECT_TOKEN and PUBLIC_POSTHOG_HOST are not documented for collaborators. [MEDIUM]

File changes

Filename Score Description
src/components/posthog.astro 4/5 New PostHog initialization component with snippet, is:inline, View Transitions guard, and capture_pageview: 'history_change'. Uses older snippet version and stale defaults date.
src/layouts/Layout.astro 5/5 Imports and mounts PostHog component in <head> — correct placement.
src/pages/index.astro 5/5 Adds click tracking for hero CTA buttons with proper listener cleanup for View Transitions.
src/pages/pricing.astro 3/5 Tracks pricing CTA clicks with enriched properties (plan, price) but pricing_page_viewed fires twice on initial load.
src/pages/features.astro 3/5 Tracks features_page_viewed but fires twice on initial load due to dual listener registration.
src/pages/docs.astro 5/5 Tracks docs section clicks with section name property. Proper listener pattern.
src/components/Navigation.astro 5/5 Tracks "Get Started" nav CTA click with proper cleanup.
src/components/Footer.astro 5/5 Tracks footer link clicks with link name property using data attributes.
package.json 4/5 Adds posthog-js to dependencies, though only the HTML snippet is used (not imported).
.gitignore 5/5 Adds .env to prevent committing secrets.
posthog-setup-report.md 5/5 Comprehensive setup report with event inventory, dashboard links, and verification checklist.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors or type issues; is:inline correctly prevents Astro TS processing
Preserves existing env vars & configs Yes Existing code and configs preserved; only PostHog additions
No syntax or type errors Yes All scripts use valid syntax; define:vars correctly passes env vars
Correct imports/exports Yes PostHog component import in Layout.astro is correct
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None Base app is clean

Issues

  • No .env.example file: PUBLIC_POSTHOG_PROJECT_TOKEN and PUBLIC_POSTHOG_HOST are required but not documented in a committed .env.example file. Add one so collaborators know which variables to set. [MEDIUM]
  • Unnecessary posthog-js in package.json: The integration uses the HTML snippet (loaded from CDN), so posthog-js in dependencies is unused. It won't break anything but adds unnecessary weight. [LOW]

Other completed criteria

  • .env added to .gitignore to prevent committing secrets
  • Build configuration (package.json) is valid
  • All is:inline directives correctly applied per Astro framework rules

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes HTML snippet in posthog.astro loads SDK from CDN; posthog-js also in package.json (redundant but valid)
PostHog client initialized Yes Initialized via snippet with __posthog_initialized guard for View Transitions, capture_pageview: 'history_change' for soft navigation tracking
capture() Yes 10 meaningful capture calls across pages and components
identify() N/A Static marketing site with no authentication system — no user identity to link
Error tracking No No captureException, startExceptionAutocapture(), or exception autocapture config
Reverse proxy No No reverse proxy configured; client-side PostHog requests may be blocked by ad blockers

Issues

  • No error tracking: No exception autocapture or captureException setup. Add capture_exceptions: true to the posthog.init() config or call posthog.startExceptionAutocapture(). [MEDIUM]
  • No reverse proxy: Client-side PostHog is exposed to ad blockers. Configure a reverse proxy (Cloudflare, Vercel rewrites, or PostHog managed proxy) and update api_host. [MEDIUM]
  • Older snippet version: The snippet uses s.api_host+"/static/array.js" instead of the recommended s.api_host.replace(".i.posthog.com", "-assets.i.posthog.com") + "/static/array.js" pattern for asset loading. [LOW]
  • Stale defaults date: defaults: '2026-01-30' should be '2026-05-30' per current docs. [LOW]

Other completed criteria

  • API key loaded from PUBLIC_POSTHOG_PROJECT_TOKEN env var (not hardcoded)
  • API host loaded from PUBLIC_POSTHOG_HOST env var with fallback to https://us.i.posthog.com
  • View Transitions initialization guard prevents stack overflow
  • capture_pageview: 'history_change' correctly handles soft navigation pageview tracking
  • is:inline directive used on all script tags per Astro framework rules
  • PUBLIC_ prefix used for client-side env vars per Astro conventions

PostHog insights and events ⚠️

Filename PostHog events Description
src/pages/index.astro hero_trial_cta_clicked, hero_docs_cta_clicked Tracks hero section CTA engagement — top of funnel
src/components/Navigation.astro nav_get_started_clicked Tracks navigation CTA clicks
src/pages/pricing.astro pricing_page_viewed, starter_plan_cta_clicked, pro_trial_cta_clicked, enterprise_contact_sales_clicked Pricing funnel: page view → plan selection. Enriched with plan name and price.
src/pages/features.astro features_page_viewed Tracks feature page interest
src/pages/docs.astro docs_section_clicked Tracks documentation section engagement with section name
src/components/Footer.astro footer_link_clicked Tracks footer navigation with link name property

Issues

  • Duplicate page view events on initial load: pricing_page_viewed and features_page_viewed fire twice on initial page load. Both DOMContentLoaded and astro:page-load trigger the setup function which immediately calls capture(). Fix by only using astro:page-load (which fires on both initial and soft navigations) or adding a deduplication guard. [MEDIUM]

Other completed criteria

  • Events represent real user actions mapped to actual product flows (CTA clicks, page views, plan selection)
  • Events enable product insights — pricing funnel (page view → plan CTA), docs engagement, feature interest
  • Events include relevant properties (plan name, price, section name, link name)
  • No PII in event properties
  • Consistent snake_case naming convention with descriptive action names

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