Skip to main content
Michael_Soprano
Level 10
May 27, 2026
Solved

CJA metric creation

  • May 27, 2026
  • 3 replies
  • 23 views

I would like to understand CJA in depth so here is my question. Additionally I understand SQL well (I assume CJA is SQL  on the back-end….)

Assume I have two events with the same structure - XDM paths:

 

Event1 - add to cart  

{   product.price: 55, 
     eventType: addToCart   }  

 

Event2 - purchase 

{   product.price: 33, 
     eventType: purchase   }  

 

How to create metric which tracks only product.price when eventType is purchase?

Best answer by EurosIMS

@MandyGeorge is spot on, you would use a derived field. There is more than one specific way to do it- this is what I do though:



You could also use the purchase incrementor instead of the event type for the same result:

 

Both s​​hould give exact same output.

Be aware there is 2 different priceTotal values in the standard ecomm schema fields: one for the order total on purchase, & one for the product price. These will almost certainly be different values: 

So if you specifically want the product prices on Purchase, you need to use the correct one.

3 replies

MandyGeorge
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 27, 2026

I don’t have a lot of CJA experience, and the only report suite I have access to is demo data, but I think you should be able to do this with a derived field.

You need to drag in a “case when” condition. Set your condition to be that eventType = purchase. Then set value to product.price (I don’t have access to those same variable names, so I just used other ones as place holders).

Then there is the “otherwise set value to” and you can select no value. So this should return the product price only for purchase events. 

 

EurosIMS
EurosIMSAccepted solution
Level 4
May 28, 2026

@MandyGeorge is spot on, you would use a derived field. There is more than one specific way to do it- this is what I do though:



You could also use the purchase incrementor instead of the event type for the same result:

 

Both s​​hould give exact same output.

Be aware there is 2 different priceTotal values in the standard ecomm schema fields: one for the order total on purchase, & one for the product price. These will almost certainly be different values: 

So if you specifically want the product prices on Purchase, you need to use the correct one.

Michael_Soprano
Level 10
May 28, 2026

@EurosIMS thanks mate!