Segment Integration
Send your simulated events to Segment for centralized data collection and distribution to downstream tools.
Overview
Segment is a customer data platform that acts as a central hub for collecting, cleaning, and routing your customer data to hundreds of destinations. MockCDP integrates with Segment's HTTP Tracking API to send realistic e-commerce events for testing your data pipeline.
Required Credentials
- Write Key: Your Segment source write key
- Data Plane URL: Optional custom data plane URL (uses Segment's default if not provided)
Setup Instructions
1. Get Your Write Key
- Log into Segment
- Navigate to Sources
- Select your JavaScript/Website source (or create one)
- Go to Settings → API Keys
- Copy the Write Key
2. Optional: Custom Data Plane
If you're using Segment's Regional or Private Cloud offerings:
- EU Data Plane:
https://api.segment.io/v1
- Custom Domain: Your organization's custom tracking domain
3. Configure in MockCDP
- Navigate to Destinations in MockCDP
- Find Segment in the list
- Toggle Enable to on
- Enter your Write Key
- Optionally enter your Data Plane URL
- Click Test Credentials to verify connection
- Click Save Configuration
Event Mapping
MockCDP sends Segment-spec compliant e-commerce events:
Event Type | Segment Event | Key Properties |
---|---|---|
Page | page() | name, category, url, referrer |
Track | Product Viewed | product_id, name, price, category |
Track | Product Added | product_id, name, price, quantity |
Track | Checkout Started | order_id, checkout_id, value, products |
Track | Order Completed | order_id, total, revenue, products |
Identify | identify() | userId, email, name, traits |
Data Quality Features
Automatic Data Enrichment
- Context Object: IP, user agent, timezone, locale
- Consistent User IDs: Stable anonymous and user IDs
- Session Management: Proper session tracking and attribution
- Timestamps: ISO 8601 formatted timestamps
E-commerce Spec Compliance
- Full adherence to Segment's E-commerce spec
- Standard property naming conventions
- Required and optional fields properly structured
- Product arrays with complete metadata
Best Practices
- Test Mode: Use a separate Segment source for testing
- Rate Limiting: Start with lower event volumes to avoid rate limits
- Schema Validation: Use Segment's schema validation features
- Debugger: Monitor events in Segment's Event Debugger
- Downstream Testing: Verify data reaches your connected destinations
Need Help?
Check our troubleshooting guide or contact support.