Expand my Community achievements bar.

SOLVED

How to do nested IIF logic in AEP Edge Mapping - Is it even possible for arrays?

Avatar

Community Advisor

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

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Having assumed that it is either not possible or that it is untenable (if possible), I have created the AA via AEP Web SDK extension for Adobe Data Collection (Launch).  This makes it very easy to accomplish the task of data collection for Adobe Analytics using the AEP Web SDK.  The extension is public and is freely available for use. 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Having assumed that it is either not possible or that it is untenable (if possible), I have created the AA via AEP Web SDK extension for Adobe Data Collection (Launch).  This makes it very easy to accomplish the task of data collection for Adobe Analytics using the AEP Web SDK.  The extension is public and is freely available for use.