Skip to main content
Solved

Can you query against nested event properties?

  • October 14, 2021
  • 2 replies
  • 1783 views

With data coming into Amplitude from Segment, I have an event that tracks orders that looks like the below example.

analytics.track('user@email.com', 'Order Completed', {
    'email': 'user@email.com',
    'order_id': '12345',
    'platform': 'Website',
    'products': [
        {
            'category': 'Soap',
            'price': 4.99,
            'sku': 'SP-SML'
        }
    ],
    'sales_channel': 'Website',
    'shipping': 0.0,
    'total': 4.99
})

Is it possible to create a chart that can then track the different Category values here? Bearing in mind it is possible for one of these events to have multiple products in it.

Best answer by belinda.chiu

Hi @edparry ! Welcome to the Amplitude Community! :wave_tone1:

I noticed you mentioned you are sending this data from Segment in which I found that “All event properties, except products, are sent as event_properties of the Amplitude “Order Completed” event. Information about each product is present only on the individual “Product Purchased” events.” https://segment.com/docs/connections/destinations/catalog/amplitude/#order-completed

Since the “category” property that you are referring to is under the “products” field, this “category” property should then be found under the Products Purchased events in which you can then create a chart looking at the category values for Products Purchased! 

View original
Did this topic help you find an answer to your question?

2 replies

Saish Redkar
Expert
Forum|alt.badge.img+10

Hey @edparry 

In most of such cases, Amplitude will stringify the nested json and querying the individual key becomes an issue.

Here are a few posts which can help you understand this issue better and get around a possible solution - 

 

Hope this helps!


belinda.chiu
Team Member
Forum|alt.badge.img+8
  • Amplitude Support
  • 189 replies
  • Answer
  • October 14, 2021

Hi @edparry ! Welcome to the Amplitude Community! :wave_tone1:

I noticed you mentioned you are sending this data from Segment in which I found that “All event properties, except products, are sent as event_properties of the Amplitude “Order Completed” event. Information about each product is present only on the individual “Product Purchased” events.” https://segment.com/docs/connections/destinations/catalog/amplitude/#order-completed

Since the “category” property that you are referring to is under the “products” field, this “category” property should then be found under the Products Purchased events in which you can then create a chart looking at the category values for Products Purchased! 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings