Implementing Server-Side Event Tracking with Mixpanel: Challenges and Solutions
Hello Mixpanel Community, I'm working on implementing server-side event tracking and encountering some challenges. Here's my specific situation: Question: Is it possible to send conversions directly to Mixpanel without implementing a client-side pixel? Specifically, can we track conversions from any traffic source without requiring a pre-existing user identification? Current Implementation: I'm receiving webhook data from Everflow and attempting to send it to Mixpanel's /track endpoint. Here's my setup: 1. Data Source: Everflow webhook providing event data in JSON format (including user details, event information, and campaign parameters) 2. Implementation: JavaScript script transforming the data to match Mixpanel's requirements 3. Endpoint: Using Mixpanel's /track endpoint Code Implementation: javascript
const everflowData = $input.first().json.body;
const projectToken = $node["Token"].parameter.assignments.assignments[0].value;
const mixpanelEvent = {
event: everflowData.event_name,
properties: {
distinct_id: everflowData.user_id,
time: parseInt(everflowData.timestamp),
// [Additional properties included]
token: projectToken,
},
};
return [{ json: mixpanelEvent }];
Current Issue: I'm receiving the following error response from Mixpanel: json
{
"error": "data, missing or empty",
"status": 0
}
I'd greatly appreciate any guidance on: 1. Whether this server-side implementation approach is feasible 2. What might be causing the "data, missing or empty" error 3. Any necessary adjustments to make this work Thank you in advance for your help! Best regards