Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

Products Variable configuration in Adobe Analytics

Avatar

Level 2

Hi, 

 

We Implemented products variable in our app based on this article, https://developer.adobe.com/client-sdks/documentation/adobe-analytics/product-variable/#products-var... and App developer has been Implemented the Products Variable code. How to configure Products variable in Adobe Analytics or AEP mobile SDK?

 

 

Thanks!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

In this case, you would have to track each line separately, also, if each line is "45" you would have had to track "45" as the Price... Adobe multiplies the quantity and price together into you Revenue, so doubling the value in your code would have ended up as $180 in your Revenue instead of $90 - Price is price per unit... 2 items at $45 = $90 in the final Revenue):

 

However, if you need to itemize "Wireless Lines", then you should track like this:

 

changePlanDataMapTest["&&products"] = ";1879;1;45.00;;eVar21=00001113-1,;1879;1;45.00;;eVar21=00001113-3,;1880;1;15.00;;eVar21=00001113-2";

 

Basically:

  • Product 1
    • [no category]
    • Product ID: 1879
    • Quantity: 1
    • Price: 45.00
    • [no event]
    • Merchandising eVars
      • eVar21: 00001113-1
  • Product 2
    • [no category]
    • Product ID: 1879
    • Quantity: 1
    • Price: 45.00
    • [no event]
    • Merchandising eVars
      • eVar21: 00001113-3
  • Product 3
    • [no category]
    • Product ID: 1880
    • Quantity: 1
    • Price: 15.00
    • [no events]
    • Merchandising eVars
      • eVar21: 00001113-2

 

Make sense?

View solution in original post

19 Replies

Avatar

Community Advisor and Adobe Champion

So when the developer sets up code in the app like:

cdata.put("&&events", "event1"); 
cdata.put("&&products", ";Running Shoes;1;69.95;event1=5.5;eVar1=Merchandising,;Running Socks;10;29.99");

 

There's not much more that you need to do.

 

Unlike passing context variables (which need to be mapped using processing rules), this should pass the event and Product Data (and all merchandising eVars) directly into your tracking... in fact, Processing Rules cannot see or update the Products List at this time (which is why you need to send it directly, and also why any paired events for products need to be send this way too...  since you probably won't be able to identify specifically which events need to be set to go with products - all other events can still be set using processing rules.)

 

Now, I am going to assume you are familiar with the Products List itself, and how to set up all the eVars as "Product Syntax" merchandising eVars... as long as all of these are configured; I am going to assume that you are tracking your mobile app into the same suite as your website, and using all the same dimensions; if so, everything should be configured.

 

Are you seeing missing data after making this update?

Avatar

Level 2

Hi @Jennifer_Dungan,

 

We are not using events in our code.

 

My Code Syntax: 

cdata.put("&&products", "Category;Product;Quantity;Price;;eVar1=Merchandising eVar,Category;Product;Quantity;Price;; eVar1=Merchandising eVar ");


Example:

contextdata.put("&&products", ";1879;2;90.00;;eVar21=wirelessLineId,1880;1;15.00;; eVar21=wirelessLineId ");

We are tracking data in different reportsuites for Mobile App and Website.

 

Thanks.

 

Avatar

Community Advisor and Adobe Champion

Ok, 

 

So as long as you have eVar1 configured with "Product Syntax" you should be fine:

Jennifer_Dungan_0-1690809119795.png

 

 

 

However, I believe that you must have the "purchase" event in order for price and quantity to work, this can be set in your processing rules (so long as you can identify the page view or action which contains a purchase (such as page name or action is "purchase success"... since you cannot see products list in processing rule logic)

 

https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=e...

 

Areas of note:


  • Quantity (optional): How many of this product is in the cart. This field only applies to hits with the purchase event.
  • Price (optional): The total price of the product as a decimal. If quantity is more than one, set price to the total and not the individual product price. Align the currency of this value to match the currenyCode variable. Do not include the currency symbol in this field. This field only applies to hits with the purchase event.

If you aren't setting the "purchase" event, Adobe will ignore price and quantity... but your product name and eVar should be set...

 

Also, I am going to assume this was just a typo, but just in case:


Example:

contextdata.put("&&products", ";1879;2;90.00;;eVar21=wirelessLineId,1880;1;15.00;; eVar21=wirelessLineId ");


You are missing a ; after the comma

contextdata.put("&&products", ";1879;2;90.00;;eVar21=wirelessLineId,;1880;1;15.00;; eVar21=wirelessLineId ");

 

(since you aren't using category, you need to have an "empty string" passed to the second product, otherwise, your category will be "1880", the product will be "1", and eVar will be passed a an event, which is invalid and the entire string could be thrown out by Adobe. If there are any issues with Products syntax, Adobe would defer to not taking any of the info at all rather than corrupt the data)

 

 

When you are testing your mobile app, hopefully you have AEP Assurance extension, this will allow you to see what you are sending to Adobe and the resulting way that the post-processing mapping compiles the data and is set in your tracking... if there is an issue in products, you will see the final result and if the data is thrown out... 

Avatar

Level 2

Hi @Jennifer_Dungan , Good Morning

 

I followed the steps that you mentioned above, Configured eVar5 with Product syntax. But, Purchase Value is displayed as 'Unspecified'

 

Sivateja123_0-1691594718738.png

Sivateja123_1-1691594748105.png

Can you please let me know the issue?

Avatar

Community Advisor and Adobe Champion

Can you share the products string that is being sent to Adobe? (You can send it to me privately if you are concerned about sharing it here)

Avatar

Community Advisor and Adobe Champion

Ok, for anyone following this, or who comes across this later, I am going to change the values.

 

Essentially, here is the Products String as sent:

 

";12345;1;10.00;; someName =item1,;34566;1;15.00;; someName =Item2"

The issue is that either the proper eVar isn't being declared (and the entire "someName =item1" is being passed, or "someName" is the name of the eVar and was being used instead of the eVar id (i.e. "eVar5")

 

The proper string (assuming that "someName" shouldn't be sent in the data is:

 

";12345;1;10.00;;eVar5=item1,;34566;1;15.00;;eVar5=Item2"

I am also recommending to strip the extra spaces from around the eVar id and equals sign... I don't know how picky this is... but I would hate for extra spaces to be a reason for this to fail; I've always made sure to clean extra spaces up to be safe.

 

Right now, the Merchandising eVar is failing because Adobe really doesn't know where to put it..  You can have multiple eVars in your product string, so you need to clearly show where each one is mapped, for example:

 

";12345;1;10.00;;eVar5=item1|eVar6=red,;34566;1;15.00;;eVar5=Item2|eVar6=blue"

using a pipe (|) to separate each eVar

Avatar

Level 2

Hi @Jennifer_Dungan , Good Morning

 

Thanks. based on your smaple code (";12345;1;10.00;;eVar5=item1,;34566;1;15.00;;eVar5=Item2")

 

I created Quantity & Price Standard events, But Data is not captured in Standard events.

Sivateja123_0-1691762258715.png

Can you please help me to over this issue?

 

Thanks!

 

Avatar

Community Advisor and Adobe Champion

Quantity and Price will only apply when the "purchase" event is fired... without that, any information sent to price or quantity will be ignored.

 

https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=e...

 

  • Quantity (optional): How many of this product is in the cart. This field only applies to hits with the purchase event.
  • Price (optional): The total price of the product as a decimal. If quantity is more than one, set price to the total and not the individual product price. Align the currency of this value to match the currencyCode variable. Do not include the currency symbol in this field. This field only applies to hits with the purchase event.

Avatar

Community Advisor and Adobe Champion

On the purchase event, you will need to change:

 

cdata.put("&&events", "event1");

 

to

 

cdata.put("&&events", "event1,purchase");

 

You can continue to collect event1, but you need "purchase" to trigger Adobe to take the quantity and the price and multiply them to populate your Revenue metrics.

 

If you need to be able to access quantity and product price separately, I would create some eVars for that.

Avatar

Community Advisor and Adobe Champion

Oh, you will also probably need to make sure that the order id / transaction id is also properly set.. I believe purchases are de-duplicated based on a transaction id, and without this, I think you will still have a potential issue... 

Avatar

Level 2

Hi @Jennifer_Dungan ,

 

I need to capture two different Values for one Merchandising eVar.

 

Sample code:

 

val changePlanDataMapTest = mutableMapOf<String, String>()
changePlanDataMapTest("&&events", "event2,purchase");
changePlanDataMapTest["&&products"] = ";1879;2;90.00;;eVar21=00001113-1,00001113-3,;1880;1;15.00;;eVar21=00001113-2";

changePlanDataMapTest["purchase"] = "1";

changePlanDataMapTest["orderid"] = "1234554321";

 

As per the above code for one Product, I need to capture two Merchandising eVar Values.

 

Only one eVar value is captured in Analytics for one product for the above code:

Sivateja123_0-1692262021832.png

 

 

Thanks!

 

Avatar

Community Advisor and Adobe Champion

You cannot capture multiple values into an eVar... what you have there, that comma is indicating the end of the product and the start of a new one, so if we look at your code above with each "item" broken into a lisy of items (i.e. I am removing the commas and semi-colons and displaying as a list of items):

 

  • Product 1
    • [no category]
    • Product ID: 1879
    • Quantity: 2
    • Price: 90.00
    • [no event]
    • Merchandising eVars
      • eVar21: 00001113-1
  • Product 2
    • Category: 00001113-3
    • [no product]
    • [no quantity]
    • [no price]
    • [no events]
    • [no eVars]
  • Product 3
    • [no category]
    • Product ID: 1880
    • Quantity: 1
    • Price: 15.00
    • [no events]
    • Merchandising eVars
      • eVar21: 00001113-2

 

I am unsure why you need to pass two eVar21 values in one product call?

 

If this is like a package deal, surely that combined package would have it's own value for the package (or if these values represent different things, why not have eVar21 for X and another eVar for Y???...

 

but for whatever reason, if this is not the case both values absolutely must be passed into eVar21, then you are going to have to pass the ids conjoined as a single value, then use classifications later to split them.

 

If you are doing that, you will have to avoid standard Products List delimiters like commas, semi-colons and pipes; as well as delimiters that could be part of the values in your eVar21 data, currently I only see the use of dashes (but I don't want to assume anything).

 

So at this point, I would maybe use a delimiter like underscore (_) or colon (:)

Such that your eVar21 will look like:

eVar21=00001113-1_00001113-3

or

eVar21=00001113-1:00001113-3

 

So as to not trigger Adobe's processing (split on comma, semi-colon and pipe), and to make it easier for you to create a Classification Rule on eVar21 where you can then split the eVar21 into multiple values (but you will still need 2 classifications, so why not just split it into multiple eVars to begin with??)

 

To pass multiple eVars (going to use eVar21 and eVar22 as an example):

 

changePlanDataMapTest["&&products"] = ";1879;2;90.00;;eVar21=00001113-1|eVar22=00001113-3"

 

 

 

In either case you will need to access "00001113-1" and "00001113-3" in different eVars, or in different classifications (i.e. basically a sub-eVar).. or you will just have to deal with a conjoined "00001113-1:00001113-3" in your data.

Avatar

Level 2

Hi @Jennifer_Dungan 

 

Ok, Let me explain our actual requirement.

 

When the user changes two or more lines at a time with the same plan(product). We need to capture those line numbers in eVar21

 

Example: 1879 is the Plan(product) and if the user changes two lines, the Quantity will be 2, and Price of each line is 45.00. So, total will be 90.00 and in eVar21 we need to capture 2 line numbers as per below snapshot.

Sivateja123_0-1692282647520.png

 

Thanks!

 

Avatar

Correct answer by
Community Advisor and Adobe Champion

In this case, you would have to track each line separately, also, if each line is "45" you would have had to track "45" as the Price... Adobe multiplies the quantity and price together into you Revenue, so doubling the value in your code would have ended up as $180 in your Revenue instead of $90 - Price is price per unit... 2 items at $45 = $90 in the final Revenue):

 

However, if you need to itemize "Wireless Lines", then you should track like this:

 

changePlanDataMapTest["&&products"] = ";1879;1;45.00;;eVar21=00001113-1,;1879;1;45.00;;eVar21=00001113-3,;1880;1;15.00;;eVar21=00001113-2";

 

Basically:

  • Product 1
    • [no category]
    • Product ID: 1879
    • Quantity: 1
    • Price: 45.00
    • [no event]
    • Merchandising eVars
      • eVar21: 00001113-1
  • Product 2
    • [no category]
    • Product ID: 1879
    • Quantity: 1
    • Price: 45.00
    • [no event]
    • Merchandising eVars
      • eVar21: 00001113-3
  • Product 3
    • [no category]
    • Product ID: 1880
    • Quantity: 1
    • Price: 15.00
    • [no events]
    • Merchandising eVars
      • eVar21: 00001113-2

 

Make sense?

Avatar

Community Advisor and Adobe Champion

Great! I'm glad its working now

Avatar

Level 2

Hi, posting along for a double check, is this true? 
"Adobe multiplies the quantity and price together into you Revenue"

 

Adobe seems to actually divide Price by quantity from products string rather than multiply. 

 

https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/page-vars/products

"Price (optional): The total price of the product as a decimal. If quantity is more than one, set price to the total and not the individual product price. Align the currency of this value to match the currencyCode variable. Do not include the currency symbol in this field. This field only applies to hits with the purchase event."

 

specifically the "If quantity is more than one, set price to the total and not the individual product price."

Avatar

Community Advisor and Adobe Champion

Hmm... that seems overly complicated... I don't have a traditional shopping cart... I deal with subscriptions, so only one can be purchased at time...  but since "quantity" doesn't surface anywhere in the reports (aside from raw data), and most people know what the individual price is... having to tally each product to a total seems kind of silly... but it might be like that...

 

I will have to test that out...