The identity traits doc needs to be updated to men...
# support
t
The identity traits doc needs to be updated to mention that for the Ruby SDK, the user id is meant to be passed in as
user_id
and not
userId
https://www.rudderstack.com/docs/event-spec/standard-events/identify/#user-id See the Ruby SDK which says to use `user_id`: https://github.com/rudderlabs/rudder-sdk-ruby/blob/6b37129e421b2a865f0de9547086b4fc915b104a/lib/rudder/analytics/client.rb#L57C30-L57C30
🙏 1
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.
t
It's also even worse because in this docs here, it says user id is
id
https://www.rudderstack.com/docs/event-spec/standard-events/identify/#identify-traits
g
thank you for reporting 🙏
t
What is the correct naming and casing for the common traits? It seems to be a mixture of camel and snake case depending
m
The way I learnt it JS is generally camel case and Ruby is snake case.
t
@shy-kite-21035 Yes that is true.. but the problem here is inconsistent guidance. Does this mean every property in the ruby SDK should be snake case? So the documentation is wrong and I shouldn't pass in
lastName
but it should be
last_name
? These docs are specific about the naming of common fields. If there is an exception for Ruby I want to know so we can properly name the events. Otherwise the mappings won't work with what rudderstack expects to translate the common fields to the correct fields for destinations. https://www.rudderstack.com/docs/event-spec/standard-events/common-fields/ Another example: For the creation date of an account, should it be passed in to the ruby sdk as
createdAt
or
created_at
? Are both supported? If not, which is the correct one? Again the reason for this confusion is the way the common fields docs are worded and teh lack of specific guidance in the Ruby SDK: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-ruby-sdk/ (It only clarifies user id as
user_id
because it's specifically shown in the examples)
g
You're correct Trevin. Although we do have some fallback mechanism to make this fault tolerant but I agree consistency would be better. We have started a discussion with the team to brainstorm on this one.
t
Whatever you do, it shouldn't break anything that exists today. What I'd recommend is this: 1. if we pass in the recommended common trait naming (e.g.
lastName
) in any sdk (including Ruby SDK) it works to be translated. 2. Ruby SDK works with snake casing for the automatic translation. so both
last_name
and
lastName
works to be translated 3. Update the docs in common traits and the ruby SDK to mention this 🙂
In meantime, can you clarify what actually happens today in the ruby sdk if i pass in
lastName
? does it get translated correctly as a recognized common trait even if other keys are passed in with snake casing (like
user_id
)?
g
I'm not sure about the lastName but it in case of user id, if
userId
is not present then
user_id
is considered as a fallback. And that's the strategy for common fields required in identify so I'd assume this would be the same for lastName. One should refer SDK docs for the recommended naming in its current form.
t
but I'm not sure about lastName that's why i'm asking
the docs are completely unclear. The Ruby SDK does not mention anything about other common trait fields.
My brief glance at the Ruby SDK, i can see the fallback for
user_id
but don't see any special handling for other traits. So my assumption is they are passed through as is (so
lastName
passed in, is passed along as
lastName
to the Rudderstack pipeline) and then is CORRECTLY translated for the destinations. I need to know if this is correct.
g
That is also my understanding as of now. Allow me sometime to confirm this with the team.
m
Hi Trevin, yes the team is aware of the inconsistencies in the docs. They are looking to fix it but it will take some time. I am confident the team will make the changes backward compatible and so you can be assured of that.