Issue
When sending an event to the Segment API, a 200 response is received, but the event does not appear in the Segment Debugger or Profile pages.
Product
Segment
Environment
Segment Console
Cause
The event payload sent to the Segment API does not match the required structure. Specifically, key names such as "event" and "userId" must be used instead of alternatives like "event_name" or "user_id". Segment HTTP direct calls require strict adherence to the expected JSON schema.
Resolution
Ensure the event payload uses the correct key names and structure as specified in Segment documentation. For example, here's a complete sample of a Track call:
{
"anonymousId": "23adfd82-aa0f-45a7-a756-24f2a7a4c895",
"context": {
"library": {
"name": "analytics.js",
"version": "2.11.1"
},
"page": {
"path": "/academy/",
"referrer": "",
"search": "",
"title": "Analytics Academy",
"url": "https://segment.com/academy/"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36",
"ip": "108.0.78.21"
},
"event": "Course Clicked",
"integrations": {},
"messageId": "ajs-f8ca1e4de5024d9430b3928bd8ac6b96",
"properties": {
"title": "Intro to Analytics"
},
"receivedAt": "2015-12-12T19:11:01.266Z",
"sentAt": "2015-12-12T19:11:01.169Z",
"timestamp": "2015-12-12T19:11:01.249Z",
"type": "track",
"userId": "AiUGstSDIg",
"originalTimestamp": "2015-12-12T19:11:01.152Z"
}Additional Information
Payloads generated from other tools or mapping interfaces may not always match the required API schema. Always refer to Segment's official documentation for the correct payload structure when making direct API calls. You can read more about it on their official documentation for: