Agent skill · Data & Analytics

segment-cdp

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.

Nick44,414★ · +328/wk · 1 repos on radarProfile →
claude-codecodexcursorMIT
Install
npx skills add sickn33/agentic-awesome-skills --skill segment-cdp --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 20 KB
Bundled scripts: none
Path: skills/segment-cdp/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 44,414 · +328 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Provides Expert patterns for Segment CDP usage including browser analytics, server-side tracking, tracking plans with Protocols, identity resolution, destinations configuration, and data governance practices.

How it works

  • Analytics.js Browser Integration: demonstrates client-side tracking with Analytics.js, including identify, track, page, and group calls. Includes a Next.js example with an AnalyticsBrowser instance, typed UserTraits, and helper functions identify, track, page, group. Provides a React hook usePageTracking that records page views on route changes and example usages in components (PricingButton) and auth flow (onUserLogin).
  • Context: browser tracking, website analytics, client-side events.
  • Server-Side Tracking with Node.js: shows server-side tracking using @segment/analytics-node with batched flushing, and typed ServerContext. Exposes serverIdentify, serverTrack, and closeAnalytics. Includes usage in API routes (example for Stripe webhooks) and a graceful shutdown handler.
  • Context: server-side tracking, backend events, webhook processing.
  • Tracking Plan Design: outlines event schemas and Protocols integration using a conceptual YAML-like structure, with identify traits and events like User Signed Up, Product Viewed, Order Completed. Includes a TypeScript implementation for type-safe tracking via TrackingEvents and trackEvent, plus usage example.
  • Context: tracking plan, data governance, event schema.
  • Identity Resolution: explains tracking anonymous users, merging with identified users, and using alias for identity merging. Provides identity flow code with trackAnonymousAction, identifyUser, associateWithCompany, linkIdentities, and a full signup flow handleSignup.
  • Context: user identification, anonymous tracking, B2B tracking.
  • Destinations Configuration: describes routing data to various destinations, enabling/disabling integrations per destination, and a sample trackWithDestinations function with a focused trackRevenue example and identifyWithPII to restrict PII to trusted destinations.
  • Context: data routing, destination setup, tool integration.
  • HTTP Tracking API: direct HTTP API for environments like edge functions, with Batch support and an HTTP API surface via httpIdentify, httpTrack, httpPage, and httpBatch.

When to use it

Use when you need a comprehensive, pattern-based implementation of Segment CDP across client and server environments, including identity resolution, governance, and flexible destination routing. Trigger usage in projects requiring typed, end-to-end Segment integration and clear patterns for events, traits, and context.

What it can touch

  • Client-side analytics via Analytics.js (Browser)
  • Server-side analytics via @segment/analytics-node (Server)
  • HTTP API endpoints for identify/track/page/batch via httpIdentify, httpTrack, httpPage, httpBatch
  • Destination integrations configuration within tracking calls (trackWithDestinations, trackRevenue, identifyWithPII, enrichedTrack)
  • Type-safe event definitions (TrackingEvents) and helper functions (trackEvent)

Caveats

  • License: MIT
  • Risk: safe
  • No explicit outcomes promised; examples show usage patterns and code scaffolds only.
From the SKILL.md

# Segment CDP 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. ## 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. // Next.js - Analytics provider component // lib/segment.ts import { AnalyticsBrowser } from '@segment/analytics-next'; export const analytics = AnalyticsBrowser.load({ writeKey: process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY!, }); // Typed event helpers export interface UserTraits { email?: string; name?: string; plan?: 'free' | 'pro' | 'enterprise'; createdAt?: string; company?: { id: string; name: string; }; } export function identify(userId: string, traits?: UserTraits) { analytics.identify(userId, traits); } export function track<T extends Record<string, any>>( event: string, properties?: T ) { analytics.track(event, properties); } export function page(name?: string, properties?: Record<string, any>) { analytics.page(name, properties); } export function group(groupId: st

What's inside
Steps it walks through
  1. Patterns
  2. Analytics.js Browser Integration
  3. Context
  4. Server-Side Tracking with Node.js
  5. Tracking Plan Design
  6. Identity Resolution
  7. Destinations Configuration
  8. HTTP Tracking API
  9. Sharp Edges
  10. Anonymous ID Persists Until Explicit Reset
  11. Device Mode Bypasses Protocols Blocking
  12. HTTP API Has Strict Size Limits
  13. Track Calls Without Identify Are Anonymous
  14. Write Key in Client is Visible (But Intentional)
More from agentic-awesome-skills
All skills →
About this skill
What does the segment-cdp skill do?

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.

How do I install it?

Run `npx skills add sickn33/agentic-awesome-skills --skill segment-cdp --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going