Hi! First question here (I don't know if this is t...
# support
f
Hi! First question here (I don't know if this is the right place), I'm sending contextual fields to Rudderstack but I can't see this info on MixPanel (I set up a connection between both). I can see properties, I can see the name of the event, but I can't see context fields. This is the JSON I can see on Rudderstack Live Events section: { "anonymousId": "***", "context": { "app_version": "8.82", "country": "ID", "ip": "10.**", "project_name": "FM***", "server": "2" }, "event": "Ad impressed", "messageId": "cd381d66-d020-4079-9784-8f362b857698", "properties": { "device_id": "***", "event_category": "Revenue", "format": "videos", "placement": "free_coins", "platform": "android", "session_id": "29552ea699708fc4caedfd7c2b0468a6210000", "user_cash": 46774090, "user_coins": 630, "user_level": 20 }, "rudderId": "fa61bc29-6895-42cc-8f13-fd5f01caf6d6", "timestamp": "2024-02-29T153118+01:00", "type": "track", "userId": 12478466 }
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Felipe, These are the only context properties that are mapped to destination properties (in this case Mixpanel). So context.ip should be mapped, but the remaining properties are not mapped. You would have to send these fields within the properties object for them to be sent to the destination. You can therefore use a user transformation to add the context object to the event properties such as the one below.
s
Copy code
export function transformEvent(event, metadata) {
  const {type} = event;
  if (type === 'track') {
      const context = {...event.context}
      event.properties.context = context;
  }
  return event;
}
Kindly test the transformation before using it.
f
Thanks, @shy-kite-21035. Definitely, I'll test it.