Hi folks, should we be seeing our traits in the to...
# support
a
Hi folks, should we be seeing our traits in the top-level of our event payloads as well as in context.traits? 🤔
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but 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.
a
E.g.
Copy code
[
  {
    "type": "identify",
    "sentAt": "2023-10-17T22:13:14.491Z",
    "traits": {
      "ip": "110.143.1.1",
      "email": "blah@blah.com",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36,gzip(gfe),gzip(gfe)",
      "emailVerified": true
    },
    "userId": "xxx",
    "channel": "server",
    "context": {
      "traits": {
        "ip": "110.143.1.1",
        "email": "blah@blah.com",
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36,gzip(gfe),gzip(gfe)",
        "emailVerified": true
      },
      "library": {
        "name": "analytics-node",
        "version": "2.0.4"
      }
    },
    "rudderId": "7d9a2cb9-4795-4e19-9be1-208c18e4efdb",
    "_metadata": {
      "nodeVersion": "20.8.0"
    },
    "messageId": "1ec97781-811c-4797-bb98-3cd6cfd3505f",
    "timestamp": "2023-10-17T22:13:14.490Z",
    "anonymousId": "xxx",
    "originalTimestamp": "2023-10-17T22:13:14.491Z"
  }
]
m
it depends on how are you setting in your code.
a
From what I can tell, I'm passing traits directly into identify() and not into context.traits.
m
Hi Lachlan, it also depends on whether you are using client side or server side SDKs. The docs show that you send them as traits for server side SDKs and Context > Traits for client side SDKs
a
But my example has both?
m
Yes if you send the directly (as traits) they seem to be copied to context > traits as well.
a
Ok, so just to confirm, what I am seeing is expected behaviour?
m
Yes. I tested it out. It is the expected behaviour.