I have a situation where I need to reference different paths of the data object depending on what event type is being collected. The structure of the data object loosely follows the old W3C data layer spec where there is product information held in product[*] for "product views", in cart.item[*] for "cart views" and in transaction.item[*] for "order placed" events.
I've pretty much given up on doing an edge mapping for this (and will use client-side code instead) but I want to know if it is even possible.
Here's an example of a nested IIF that I was trying to use.
iif( contains_key("data.eventNames.cartViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.cart.item[*].productInfo.productID, iif( contains_key("data.eventNames.orderPlaced") && contains_key("data.eventNames.pageLoadCompleted") , data.transaction.item[*].productInfo.productID, iif( contains_key("data.eventNames.cartViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.cart.item[*].productInfo.productID, iif( contains_key("data.eventNames.productViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.product[*].productInfo.productID, ""))))
Thanks in advance,
-Stew