Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ NEXT_PUBLIC_MATOMO_SITE_ID=
# API token for A/B testing experiments
# MATOMO_API_TOKEN=your-matomo-api-token

# Flags SDK secret (required for precomputed A/B testing)
# Generate with: openssl rand -base64 32
# FLAGS_SECRET=

# Use mock A/B experiments instead of fetching from Matomo
# Useful for local development without Matomo credentials
# USE_MOCK_EXPERIMENTS=true

# Used to avoid loading Matomo in our preview deploys
NEXT_PUBLIC_IS_PREVIEW_DEPLOY=false

Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ This project enforces type-safe chain names via TypeScript. When working with la

## A/B Testing

The site uses a GDPR-compliant, cookie-less A/B testing system integrated with Matomo. Experiments are configured in the Matomo dashboard (no code changes or deployments needed); components opt in via `ABTestWrapper` from `@/components/AB/TestWrapper`, rendered server-side with graceful fallback to the original variant.
The site uses a GDPR-compliant, cookie-less A/B testing system built on the Flags SDK precompute pattern, integrated with Matomo. The proxy assigns variants at the edge (header fingerprinting) and rewrites to signed, statically prerendered variant pages under `ab-code/[code]/` — experiments never force dynamic rendering. Experiment status, weights, and scheduling live in the Matomo dashboard (no deploys needed). Only the default locale is tested; other locales always get the original.

Key gotcha: **variants are matched by array index, not names** — the `variants` array order must match the Matomo experiment order exactly, and the `testKey` must match the Matomo experiment name exactly.

Full guide (setup, example, architecture, env vars): `docs/ab-testing.md`. Code: `app/api/ab-config/`, `src/lib/ab-testing/`, `src/components/AB/`.
Full guide (architecture, step-by-step recipe, env vars): `docs/ab-testing.md`. Code: `proxy.ts`, `src/lib/ab-testing/`, `src/components/AB/`, `app/[locale]/ab-code/`.

## Deployment

Expand Down
131 changes: 0 additions & 131 deletions app/api/ab-config/route.ts

This file was deleted.

Loading
Loading