Segment Cdp
When & Why to Use This Skill
This Claude skill provides expert guidance and implementation patterns for the Segment Customer Data Platform (CDP). It facilitates the setup of robust data collection infrastructures, covering client-side Analytics.js and high-performance server-side tracking with Node.js. By leveraging best practices for identity resolution, data governance, and tracking plan design, it ensures high-quality data flow across your entire business stack.
Use Cases
- Implementing client-side event tracking using Analytics.js to capture and analyze user behavior within web applications.
- Setting up secure, non-blocking server-side tracking with Node.js for backend events, webhooks, and sensitive customer data.
- Designing standardized tracking plans using Object + Action naming conventions to maintain data integrity and consistency.
- Configuring identity resolution and user aliasing to create a unified customer view across multiple touchpoints and platforms.
- Enforcing data governance and validation rules through Segment Protocols to prevent 'dirty data' from reaching downstream destinations.
| name | segment-cdp |
|---|---|
| description | "Expert patterns for Segment Customer Data Platform including Analytics.js, server-side tracking, tracking plans with Protocols, identity resolution, destinations configuration, and data governance best practices. Use when: segment, analytics.js, customer data platform, cdp, tracking plan." |
| source | vibeship-spawner-skills (Apache 2.0) |
Segment CDP
Patterns
Analytics.js Browser Integration
Client-side tracking with Analytics.js. Include track, identify, page, and group calls. Anonymous ID persists until identify merges with user.
Server-Side Tracking with Node.js
High-performance server-side tracking using @segment/analytics-node. Non-blocking with internal batching. Essential for backend events, webhooks, and sensitive data.
Tracking Plan Design
Design event schemas using Object + Action naming convention. Define required properties, types, and validation rules. Connect to Protocols for enforcement.
Anti-Patterns
❌ Dynamic Event Names
❌ Tracking Properties as Events
❌ Missing Identify Before Track
⚠️ Sharp Edges
| Issue | Severity | Solution |
|---|---|---|
| Issue | medium | See docs |
| Issue | high | See docs |
| Issue | medium | See docs |
| Issue | high | See docs |
| Issue | low | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
| Issue | high | See docs |