Agent skill · marketing growth · aiskillstore

segment-cdp

Expert patterns for Segment Customer Data Platform including

Why this skill is useful

Provides specific patterns and anti-patterns for implementing Segment CDP that the AI wouldn't reliably generate on its own.

What it needs

Requires segment account access. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

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.NEXTPUBLICSEGMENTWRITEKEY!, }); // 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: string, traits?: Record<string, any>) { analytics.group(groupId, traits); } // React hook for analytics // hooks/useAnalytics.ts import { useEffect } from 'react'; import { usePathname, useSearchParams } from 'next/navigation'; import { analytics, page } from '@/lib/segment'; export function usePageTracking() { const pathname = usePathname(); const searchParams = useSearchParams(); useEffect(() => { // Track page view on route change page(pathname, { path: pathname, search: searchParams.toString(), url: window.location.href, title: document.title, }); }, [pathname, searchParams]); } // Usage in app.tsx or layout.tsx function RootLayout({ children }) { usePageTracking(); return <html>{children}</html>; } // Event tracking in components function PricingButton({ plan }: { plan: string }) { const handleClick = ( …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/segment-cdp

View the source on GitHub

Browse the @skills marketplace