Skip to main content
Solved

Unable to filter by Item properties

  • December 10, 2024
  • 4 replies
  • 37 views

Forum|alt.badge.img
  • Contributor I
  • 1 reply

I have a custom integration, and for the Placed Order event, there is an array of Items. The data seems to be coming through ok (see example below), but I’m unable to see “Item” as a filter option.

My specific use case, is I want to be able to filter by by the Item.ProductID property of the items purchase in the event.

Example event (blurred some URLs):

 

As you can see in the above event, there is an array of Items that include ProductID, ImageURL, and other properties.

Trigger filter is missing “Item” filters, I can only filter by top level properties. Is this expected behavior? If not, how can I troubleshoot this?

 

Best answer by saulblum

You can only segment and filter on top-level properties of the JSON block.

https://developers.klaviyo.com/en/docs/guide_to_integrating_a_platform_without_a_pre_built_klaviyo_integration#added-to-cart-tracking-snippet

You can add as many key/value pairs as you’d like to the JSON payload, with one restriction: you can only use top-level properties in the JSON when adding filters to segments based on this event (Added to Cart in this case). That is why there is a top-level property AddedItemCategories in the below example that is the union of unique ProductCategories values of each of the products in the Items array. With this top-level property, you can create a segment of profiles who have viewed products in specific categories.

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Expert Problem Solver III
  • 158 replies
  • December 10, 2024

Hi ​@cwdev,

Is `items` the name of a profile property on any profile in your Klaviyo instance?

There’s an annoying bug that has existed for many years where Trigger Splits will not show event properties if they’re also profile properties. This bug is detailed here: 

 

Let us know.

Best,

Kevin.


talhahussain
Problem Solver IV
Forum|alt.badge.img+8
  • Problem Solver IV
  • 76 replies
  • December 10, 2024

Select “items” in “where” condition


Forum|alt.badge.img+7
  • Klaviyo Employee
  • 168 replies
  • Answer
  • December 10, 2024

You can only segment and filter on top-level properties of the JSON block.

https://developers.klaviyo.com/en/docs/guide_to_integrating_a_platform_without_a_pre_built_klaviyo_integration#added-to-cart-tracking-snippet

You can add as many key/value pairs as you’d like to the JSON payload, with one restriction: you can only use top-level properties in the JSON when adding filters to segments based on this event (Added to Cart in this case). That is why there is a top-level property AddedItemCategories in the below example that is the union of unique ProductCategories values of each of the products in the Items array. With this top-level property, you can create a segment of profiles who have viewed products in specific categories.


retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 920 replies
  • December 10, 2024

Hi ​@cwdev, following up on what ​@saulblum stated, since Klaviyo only lets you filter on the root node of an event’s payload (and not into nested arrays), you can break out and create a separate “ProductIDs” with just an array of the various product IDs similar to how you did it with “ItemNames.”  That should let you then filter by the specific ProductID.  Let us know if that worked!