
Segment CDP (Analytics.js & Server-side)
from agent-assistant47
Patterns and best-practices for implementing Segment (Analytics.js and server-side) tracking, event schema design, and avoiding common anti-patterns.
What it does
Provides concrete patterns for integrating Segment's Analytics.js on the client and @segment/analytics-node on the server, plus guidance for designing tracking plans and avoiding common mistakes. Includes practical recommendations on event naming, identify/anonymous ID handling, batching non-blocking server calls, and where to enforce validation.
When to use it
Use this skill when building or auditing analytics/tracking implementations that rely on Segment as the CDP—especially when you need consistent event schemas, safe server-side ingestion, or to fix flaky client-side identity merges. Helpful during onboarding of analytics engineers, instrumentation sprints, or when migrating tracking to a CDP-backed architecture.
What's included
- Scripts: none detected in repo (has_scripts=false)
- References: none bundled (has_references=false)
- Instructions: patterns for Analytics.js browser integration, server-side Node.js batching, tracking-plan design, anti-patterns to avoid, and a short "sharp edges" table listing problem areas and mitigations.
Compatible agents
Likely useful for agents that perform devops/engineering assistant tasks (Code-writing agents like Copilot/Codex/Gemini Code) and for QA/analytics reviewers who validate event schemas.
Tags
Information
- Repository
- agent-assistant
