<wizard-report>
# PostHog post-wizard report

The wizard has completed a deep integration of PostHog analytics into the Rubis landing page (`apps/landing`, Astro 6 SSR).

## What was done

- **`src/components/posthog.astro`** — PostHog client-side snippet component, initialised from env vars, injected into all pages via the shared layout.
- **`src/lib/posthog-server.ts`** — Server-side PostHog singleton (posthog-node), ready for use in any future API routes.
- **`src/layouts/Layout.astro`** — Added `<PostHog />` component to `<head>` so all pages (home, blog, legal, changelog) are covered.
- **`src/pages/index.astro`** — `<script is:inline>` block tracks CTA clicks (with location context), Pro plan CTA, Free/Business plan selections, and FAQ accordion opens.
- **`src/pages/blog/[slug].astro`** — `<script is:inline define:vars>` block tracks blog article views (top of funnel) and in-article CTA clicks, passing slug and title as properties.
- **`apps/landing/.env`** — `PUBLIC_POSTHOG_PROJECT_TOKEN`, `PUBLIC_POSTHOG_HOST`, `POSTHOG_PROJECT_TOKEN`, `POSTHOG_HOST` written and `.gitignore`-covered.

## ⚠️ Action required

Run the following from the monorepo root to install the packages (the sandbox could not write to the root lockfile):

```bash
cd /Users/arthurbarre/dev/saas-dir/rubis
pnpm add posthog-js posthog-node --filter @rubis/landing
```

## Events

| Event | Description | File |
|---|---|---|
| `signup_cta_clicked` | User clicked a CTA button linking to app.rubis.pro (Hero, Header, or FinalCTA) | `src/pages/index.astro` |
| `pricing_pro_cta_clicked` | User clicked the Pro plan CTA "Commencer l'essai 30 jours" | `src/pages/index.astro` |
| `pricing_plan_selected` | User clicked a Free or Business plan card | `src/pages/index.astro` |
| `faq_item_opened` | User expanded a FAQ accordion item | `src/pages/index.astro` |
| `blog_article_viewed` | User loaded a blog article page (top of blog conversion funnel) | `src/pages/blog/[slug].astro` |
| `blog_cta_clicked` | User clicked the in-article CTA block linking to app.rubis.pro | `src/pages/blog/[slug].astro` |

## Next steps

We've built a dashboard and 5 insights to monitor landing page performance:

- [Analytics basics dashboard](/dashboard/684004)
- [CTA clicks over time](/insights/wLAwvQu2) — daily volume of landing CTA clicks
- [CTA clicks by location](/insights/6Buiea4J) — which section (hero / header / pricing / final_cta) converts most
- [Blog article views over time](/insights/ktWwFnag) — daily blog traffic
- [Blog → App conversion funnel](/insights/cXUi6L1T) — conversion from article view to in-article CTA click
- [Pricing plan engagement](/insights/CaQyu6TG) — Pro CTA vs Free/Business plan card clicks

### Agent skill

We've left an agent skill folder in your project at `.claude/skills/integration-astro-ssr/`. You can use this context for further agent development when using Claude Code. This will help ensure the model provides the most up-to-date approaches for integrating PostHog.

</wizard-report>
