Cart analysis: Use object arrays to drive behavioral insights

This article helps you:

  • Unlock new insights by analyzing Amplitude data as object arrays

Amplitude's cart analysis feature enables you to analyze data sent as object arrays. This can be particularly useful for behavioral insights into e-commerce transaction and shopping cart flows. You can analyze search results or cart events in the aggregate (for example, total order volume or co-occurrence), or you can segment your analyses by dimensions such as brand, category, price, or SKU, among others.

Once you've set everything up, you'll be able to access and analyze these object arrays from within your chart. 

Likely use cases include:

  • Product performance (volume) by attribute (SKU, category, brand)
  • Conversion rates by product type (or another attribute)
  • Top-performing product combinations that reveal opportunities for cross-selling
  • Revenue and business outcomes performance by item or product
  • Average basket size or item count


Cart Analysis is available for Amplitude's Event Segmentation and Funnel Analysis charts.

Feature availability

This feature is in an open beta and only available to users on Growth and Enterprise plans. See Set up property splitting to get started. 

Terms and concepts

Here's a brief overview of the more important ideas that make cart analysis work:

  • Object array: This is a data format that can store a collection of distinct objects under a single name. In an Amplitude context, the array itself acts as an event or user property, while the objects it contains are item-specific attributes or properties. In the example below, products is the object array that holds two distinct objects.
1products: [
2 {
3 product\_id: 1,
4 sku: '45360-32',
5 name: 'Special Facial Soap',
6 category: 'Beauty',
7 price: 12.60,
8 },
9 {
10 product\_id: 5,
11 sku: '47738-11',
12 name: 'Fancy Hairbrush',
13 category: 'Beauty',
14 price: 18.90,
15 }
  • Parent property: This is the top-level event or user property that contains an array of objects; in the example above, this is products.
  • Child property (or item property): These are the nested attributes within the array of objects; these are what Amplitudes splits out for its analyses. In the example above, sku and price are two examples of child properties. These are limited to one level of nesting.
  • Sibling property: These are two or more child properties tied to the same parent event or user property. In the example above, sku and price are sibling properties.
  • Property splitting: This is the processing method Amplitude uses to split out nested child properties from parent properties in your data, after ingestion has occurred. The property splitting process will preserve the parent properties.


Child properties count toward your property volume counts.

Set up property splitting

Property splitting must be enabled before you can use object arrays for cart analysis. You can complete the process in Amplitude Data.


Only project managers and admins can enable splitting. Splitting is not supported in Portfolio projects.

To enable property splitting, follow these steps:

  1. Open Amplitude Data.
  2. Find the event or user property you want to use as a parent property and select it. (In the example used above, this is products.)


If you're using Amplitude Data, you may need to add the event you're interested in to your tracking plan.

3. In the property drawer, set Type to Array and set Item type to Any. The Splitting tab will show up on the right. 4. If the property has been seen or ingested at least once before, you'll see a preview of what the splitting process would deliver. Click Start Splitting to begin.

To stop splitting, go to the Splitting tab and click Stop Splitting.

This change will take effect for any net new data ingestion. Data will persist for previously split events. To learn more about hiding or deleting split properties, see our articles on managing events in Amplitude.

Send the cart object array

You have two options for sending the cart object array. The first is to use either the set() or append() method with the Identify API:

1const identifyEvent = new amplitude.Identify();
3// can use either set() or append()
4identifyEvent.append('products', [{
5product_id: 123,
6sku: '41245',
7name: 'Sunscreen'

The second is to send it as event properties:

1const myCartObjectArray = {"products": [{
2product_id: 123,
3sku: '41245',
4name: 'Sunscreen'
7amplitude.logEvent("Product Viewed", event_properties=myCartObjectArray)

To learn more, see the Amplitude developer documentation.

Use object arrays in your Event Segmentation and Funnel Analysis charts

As mentioned earlier, you can access the object arrays generated by the property splitting process from within your chart events—just like any other event or user property.

These arrays show up in the event / user property dropdowns and are designated by {:} :



As with standard event and user properties, you can apply conditions to filter your results. Filters work a little differently for object arrays. 

  • Cross-property filters (default): These filters point to or reference all items or objects within the array. This is also referred to as “mix and match” semantics. To apply cross-property filters, apply two separate clauses via + Filter by on the same event.


  • Parallel filters: These filters point to or reference the same item or object within the array. To apply parallel filters, add two or more contains clauses on the same item or object.



You can only apply parallel semantics on sibling properties.

  • Item match: Selecting this option tells Amplitude Analytics to respect filter conditions when displaying group-by values (for example, only electronics items).


  • Collection match: Selecting this option tells Amplitude Analytics to reference all objects in the event when displaying group-by values (for example, all items in purchases containing electronics).


Examples of queries using object arrays for cart analysis

Object arrays are highly flexible tools and are capable of complex queries. Here are some examples of expected use cases for object arrays that may help you develop your own queries.

  • Purchases containing an electronics product:


  • Purchases containing an electronics product, where the price was greater than or equal to $24.99:


  • Compare purchases containing seasonal products to purchases containing beauty products:


  • Sum the price of electronics products in any purchases that contain at least one electronics product:


Was this page helpful?

Thanks for your feedback!

July 18th, 2024

Need help? Contact Support


Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.