Files
marketingskills/tools/integrations/segment.md
T
Corey Haines 83150fdc08 feat: rename 15 skills for shorter, cleaner names
Renames:
- ab-test-setup → ab-testing
- analytics-tracking → analytics
- competitor-alternatives → competitors
- email-sequence → emails
- free-tool-strategy → free-tools
- launch-strategy → launch
- onboarding-cro → onboarding
- paywall-upgrade-cro → paywalls
- popup-cro → popups
- pricing-strategy → pricing
- product-marketing-context → product-marketing
- referral-program → referrals
- schema-markup → schema
- signup-flow-cro → signup
- social-content → social

Updates all cross-references in skills, references, tools,
marketplace.json, README, AGENTS.md, and CONTRIBUTING.md.

BREAKING: Users with installed skills will need to reinstall.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 16:21:22 -07:00

160 lines
3.0 KiB
Markdown

# Segment
Customer data platform for collecting, routing, and activating user data.
## Capabilities
| Integration | Available | Notes |
|-------------|-----------|-------|
| API | ✓ | Tracking API, Profile API, Config API |
| MCP | - | Not available |
| CLI | - | Not available |
| SDK | ✓ | analytics.js, iOS, Android, server libraries |
## Authentication
- **Tracking**: Write Key (per source)
- **API**: Access Token (OAuth 2.0)
- **Header**: `Authorization: Bearer {access_token}`
## Common Agent Operations
### Track event
```bash
POST https://api.segment.io/v1/track
Authorization: Basic {base64(write_key:)}
{
"userId": "user_123",
"event": "signup_completed",
"properties": {
"plan": "pro",
"method": "email"
}
}
```
### Identify user
```bash
POST https://api.segment.io/v1/identify
Authorization: Basic {base64(write_key:)}
{
"userId": "user_123",
"traits": {
"email": "user@example.com",
"name": "John Doe",
"plan": "pro"
}
}
```
### Track page view
```bash
POST https://api.segment.io/v1/page
Authorization: Basic {base64(write_key:)}
{
"userId": "user_123",
"name": "Pricing",
"properties": {
"title": "Pricing - Example",
"url": "https://example.com/pricing"
}
}
```
### Batch events
```bash
POST https://api.segment.io/v1/batch
Authorization: Basic {base64(write_key:)}
{
"batch": [
{"type": "identify", "userId": "user_1", "traits": {"plan": "free"}},
{"type": "track", "userId": "user_1", "event": "signup"}
]
}
```
### Get user profile (Profile API)
```bash
GET https://profiles.segment.com/v1/spaces/{space_id}/collections/users/profiles/user_id:{user_id}/traits
Authorization: Basic {base64(access_token:)}
```
### Get user events
```bash
GET https://profiles.segment.com/v1/spaces/{space_id}/collections/users/profiles/user_id:{user_id}/events
Authorization: Basic {base64(access_token:)}
```
## JavaScript SDK
```javascript
// Initialize
analytics.load('WRITE_KEY');
// Identify user
analytics.identify('user_123', {
email: 'user@example.com',
plan: 'pro'
});
// Track event
analytics.track('Feature Used', {
feature_name: 'export'
});
// Page view
analytics.page('Pricing');
```
## Key Concepts
- **Sources** - Where data comes from (website, app, server)
- **Destinations** - Where data goes (analytics, CRM, ads)
- **Tracking Plan** - Schema for events and properties
- **Protocols** - Data governance and validation
- **Personas** - Unified user profiles
- **Audiences** - Computed user segments
## Common Destinations
- Analytics: GA4, Mixpanel, Amplitude
- CRM: HubSpot, Salesforce
- Email: Customer.io, Mailchimp
- Ads: Google Ads, Meta
- Data Warehouse: BigQuery, Snowflake
## When to Use
- Centralizing event tracking
- Routing data to multiple tools
- Maintaining consistent tracking
- Building unified user profiles
- Syncing audiences across platforms
## Rate Limits
- 500 requests/second per source
- Batch up to 500KB or 32KB per event
## Relevant Skills
- analytics
- emails
- paid-ads