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

  1. Log into Segment
  2. Navigate to Sources
  3. Select your JavaScript/Website source (or create one)
  4. Go to SettingsAPI Keys
  5. 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

  1. Navigate to Destinations in MockCDP
  2. Find Segment in the list
  3. Toggle Enable to on
  4. Enter your Write Key
  5. Optionally enter your Data Plane URL
  6. Click Test Credentials to verify connection
  7. Click Save Configuration

Event Mapping

MockCDP sends Segment-spec compliant e-commerce events:

Event TypeSegment EventKey Properties
Pagepage()name, category, url, referrer
TrackProduct Viewedproduct_id, name, price, category
TrackProduct Addedproduct_id, name, price, quantity
TrackCheckout Startedorder_id, checkout_id, value, products
TrackOrder Completedorder_id, total, revenue, products
Identifyidentify()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

  1. Test Mode: Use a separate Segment source for testing
  2. Rate Limiting: Start with lower event volumes to avoid rate limits
  3. Schema Validation: Use Segment's schema validation features
  4. Debugger: Monitor events in Segment's Event Debugger
  5. Downstream Testing: Verify data reaches your connected destinations

Need Help?

Check our troubleshooting guide or contact support.