Hi RudderStackers - I am just getting to know the ...
# support
l
Hi RudderStackers - I am just getting to know the
identify
API in the Node SDK. I am seeing that the data I pass in the
traits
property of the parameter to
identify
appear twice in the payload that I see in the live event stream I see in the Rudderstack dashboard. They are in the root
traits
object and repeated in
context.traits
. Here is an example payload (all of the data was created by faker):
{
"_metadata": {
"nodeVersion": "18.19.0"
},
"channel": "server",
"context": {
"library": {
"name": "analytics-node",
"version": "2.0.6"
},
"traits": {
"createdAt": "2023-12-29T18:07:20.013Z",
"email": "nellie.daugherty@example.com",
"firstName": "Nellie",
"inactive": false,
"lastName": "Daugherty",
"middleName": "Legros",
"updatedAt": "2023-12-29T23:54:43.510Z"
}
},
"integrations": {
"All": true
},
"messageId": "fu",
"originalTimestamp": "2023-12-29T23:54:43.532Z",
"rudderId": "bar",
"sentAt": "2023-12-29T23:54:53.534Z",
"timestamp": "2023-12-29T23:54:43.529Z",
"traits": {
"createdAt": "2023-12-29T18:07:20.013Z",
"email": "nellie.daugherty@example.com",
"firstName": "Nellie",
"inactive": false,
"lastName": "Daugherty",
"middleName": "Legros",
"updatedAt": "2023-12-29T23:54:43.510Z"
},
"type": "identify",
"userId": "23b8b69c-2663-4f29-8f31-aa4698418447"
}
I see the same duplicated properties in my data warehouse. The data appears to be correct but it seems wasteful and pointless to duplicate it. How can I avoid this duplication? Thanks!
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.
h
It is there because subsequent track/page events have it in context as they dont have a traits payload, you could remove it in a transform if you really need to
l
Got it. Thanks, @hundreds-lifeguard-65770. I appreciate the explanation. Happy New Year!
I am observing that the traits are not included in subsequent
track
calls, which seems to make sense given that I am using the Node JS SDK. Anyway, certainly not a big deal but I still struggle to see the value of duplicating the traits dictionary in the
identify
events. Thanks.
m
I agree this makes sense in the client side SDKs but not really with the server-side SDKs. Let me check on this and get back to you.
ty 1