Products Variable configuration in Adobe Analytics | Community
Skip to main content
Level 2
July 28, 2023
Solved

Products Variable configuration in Adobe Analytics

  • July 28, 2023
  • 1 reply
  • 4072 views

Hi, 

 

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

 

 

Thanks!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

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.

 

Thanks!

 


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?

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 28, 2023

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?

Level 2
July 31, 2023

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.

 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 31, 2023

Ok, 

 

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

 

 

 

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=en

 

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...