Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Analytics transforms user behavior into actionable data. This skill covers integrating analytics providers (Plausible, PostHog, GA4), designing event taxonomies, building privacy-first tracking, setting up conversion funnels, and implementing A/B testing. The focus is on collecting only what matters while respecting user privacy and complying with GDPR/CCPA.
Key Concepts
Analytics Provider Comparison
Feature
Plausible
PostHog
GA4
Custom
Privacy-first
Yes (no cookies)
Configurable
No (requires consent)
You control it
Self-hostable
Yes
Yes
No
Yes
Session replay
No
Yes
No
Build it
Feature flags
No
Yes
No
Build it
A/B testing
No
Yes
Yes (Optimize sunset)
Build it
Funnels
Basic
Yes
Yes
Build it
Cost
$9+/mo or self-host
Free tier + paid
Free (with limits)
Infrastructure cost
Cookie-free
Yes
Optional
No
Your choice
GDPR compliant (no consent)
Yes (EU hosting)
Self-hosted only
No
If self-hosted
Event Taxonomy
Use a consistent naming convention across your entire application:
Past tense for completed actions: form.submitted not form.submit
Include context as properties, not in the event name: button.clicked { label: "Buy Now" } not buy_now_button.clicked
Workflow
Step 1: Choose Your Provider
Need cookie-free, GDPR-compliant out of the box?
-> Plausible
Need session replay, feature flags, and funnels?
-> PostHog
Need to integrate with Google Ads / Search Console?
-> GA4 (with consent banner)
Need full control and own your data?
-> Custom analytics pipeline
Step 2: Implement the Analytics Layer
Plausible (Privacy-First, No Cookies)
// lib/analytics/plausible.tsconstPLAUSIBLE_DOMAIN = process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN!;
constPLAUSIBLE_API = process.env.NEXT_PUBLIC_PLAUSIBLE_API_HOST ?? 'https://plausible.io';
exportfunctiontrackEvent(eventName: string,
props?: Record<string, string | number | boolean>
) {
if (typeofwindow === 'undefined') return;
if (window.location.hostname === 'localhost') return;
// Uses the Plausible Events API — no cookies, no consent neededfetch(`${PLAUSIBLE_API}/api/event`, {
method: 'POST',
headers: { 'Content-Type': 'text/plain' },
body: JSON.stringify({
n: eventName, // event nameu: window.location.href,
d: PLAUSIBLE_DOMAIN,
r: document.referrer || null,
p: props ? JSON.stringify(props) : undefined,
}),
}).catch(() => {
// Silently fail — analytics should never break the app
});
}
exportfunctiontrackPageview() {
trackEvent('pageview');
}
Never block rendering for analytics — Load scripts with defer or afterInteractive. Fire events asynchronously. Analytics failures must never break the app.
Use a unified abstraction layer — Wrap all providers behind a single track() function so you can swap providers without changing application code.
Batch events and use sendBeacon — Batching reduces HTTP requests. sendBeacon guarantees delivery on page unload, unlike fetch.
Respect Do Not Track — Check navigator.globalPrivacyControl and navigator.doNotTrack. For Plausible, this is handled automatically.
Keep event names stable — Changing event names breaks funnels and dashboards. Treat your event taxonomy like a public API.
Track properties, not event variants — Use button.clicked { label: "Sign Up" } instead of signup_button_clicked. This keeps your event count manageable.
Separate analytics API from app API — Analytics ingestion endpoints should not share rate limits or auth with your main API. Use a dedicated route.
Test tracking in development — Log events to console in dev mode instead of sending to the provider. Verify events fire before deploying.