Skip to main content

Hi! I have been logging events with the Web SDK and Ampli wrapper and I am unable to see event properties that are object types show up in the event stream. (All other properties that are primitive types are showing up).

I was assuming that I could use the property type “any” to describe an object. For example, my event could have the following properties:

  • name (string)
  • attributes (any)

And the event_properties payload the SDK sends to Amplitude looks like this:

{

  “name”: “John Doe”,

  “attributes”: { “age”: 30, “favoriteColor”: “blue” }

}

 

When I trigger the event and view the event stream, I can see the “name” property listed in the Event Properties, but I do not see the “attributes” property. Is this expected? Are objects not allowed as values? The example here is simplified for this discussion, but we have a handful of events where logging complex object types makes much more sense than normalizing the event properties.

Yes you can use object arrays in event properties @Zachary Sidnam, you need to configure this such that Amplitude will split it for you. This should help:

https://help.amplitude.com/hc/en-us/articles/9623000954907-Cart-analysis-Use-object-arrays-to-drive-behavioral-insights#h_01GGX3KMYSJX6EBW6WHRC7PEMH

 


P.S. I seem to remember you need to be on Growth or Enterprise plan to access this feature.


@dangrainger thank you for that info! In my case I am using a single object instead of an object array, but I think the same splitting functionality may apply? I don’t see the Splitting tab so I think you are correct that the feature is gated for paying customers. (It would be nice if the documentation covered this more clearly 😄).


Yes, it can still be applied in that scenario


Reply