Adobe ACP Mobile SDK - "&&& product" context data implementation | Community
Skip to main content
Level 4
October 29, 2024
Solved

Adobe ACP Mobile SDK - "&&& product" context data implementation

  • October 29, 2024
  • 1 reply
  • 4040 views

I have a ACP mobile sdk implementation using trackState and trackAction calls. Now the devs are sending data using "&&products": ";Category: infinite;Product: 160GB, Talk & Text - Plus;Quantity: 1;Price: 75.0". How do i populate it up in Adobe analytics? I tried mapping it to an eVar using processing rules but when in context data variable i typed : &&products it turned the value into products and it is not working. 

 

Please Suggest me the best solution as it is urgent 

Best answer by Jennifer_Dungan

ohh thank you so much for the information. But why are "Quantity" and "Price" is coming as  metric and not dimensions? I am just trying to understand the reasoning behind it. it is kind of difficult to create a view where we want to see cost and quantity of a particular product at the purchase

 


In the Products List notation, those are standard metrics. Even in your screen shot above from January, that was in the Success Events configuration. Revenue and number of items being sold are traditionally stored as a metric, so that you can have a total number of "product X" sold in whatever period, and a total revenue from those sales... metrics are numbers, so they will add up across the orders and you can also run calculated metrics on them... 

 

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

 

If you want to be able to see these values as actual text dimension data (as in, you want to see a specific, locked in, textual value for each order), then you will need to create some Merchandising eVars to store the values as a dimension.

 

For example:

 

You might want to keep the default "visit" expiry, or you may want it to only be part of the Sale hit, or maybe have a custom expiry.. it depends on your needs.

 

But you will definitely need to make it "Merchandising" and in Product Syntax.

 

 

Now, in your products string, you will need to add the new eVars:

 

";CCMM42255:5G Infinite Premium;250;118.75;;eVar97=250|eVar98=118.75"

 

Notice I have a double ;; in the string, this is intentional... this is the spot where custom events would be placed, if you had any... since you don't, we need to leave that there and empty.

1 reply

FarazHusain
Adobe Employee
Adobe Employee
October 29, 2024

Not sure what AEC mobile SDK is, as we only have AEP and ACP SDK for Adobe Analytics. In case you're using native Android/iOS SDK you can follow this document - https://developer.adobe.com/client-sdks/solution/adobe-analytics/product-variable/

products is set directly on the image request and auto-mapped as far as I know in the above approach, and the other variables are set as context data.

jaishalAuthor
Level 4
October 29, 2024

i am not the receiving the data that the devs are passing:

 

Value passed:

 

 "&&products": ";Category: infinite;Product: 160GB, Talk & Text - Plus;Quantity: 1;Price: 75.0"

 

Value received for Android: 160 GB

No value received for iOS

jaishalAuthor
Level 4
October 29, 2024

It should be in this format- 

 

cdata.put("&&products", "Category;Product;Quantity;Price[,Category;Product;Quantity;Price]"); 'Here's the sample: //create a context data dictionary HashMap cdata = new HashMap<String, String>(); // add products, a purchase id, a purchase context data key, and any other data you want to collect. // Note the special syntax for products cdata.put("&&products", ";Running Shoes;1;69.95,;Running Socks;10;29.99"); //This one is sending multiple products. cdata.put("myapp.purchase", "1"); cdata.put("myapp.purchaseid", "1234567890"); // send the tracking call - use either a trackAction or trackState call. // trackAction example: MobileCore.trackAction("purchase", cdata); // trackState example: MobileCore.trackState("Order Confirmation", cdata);For iOS: //create a context data dictionary var contextData = [String: Any]() // add products, a purchase id, a purchase context data key, and any other data you want to collect. // Note the special syntax for products contextData["&&products"] = ";Running Shoes;1;69.95,;Running Socks;10;29.99" contextData["m.purchaseid"] = "1234567890" contextData["m.purchase"] = "1" // send the tracking call - use either a trackAction or trackState call. // trackAction example: MobileCore.track(action: "purchase" as String, data: contextData) // trackState example: MobileCore.track(state: "Order Confirmation", data: contextData)

Can you please double check this? I doubt your syntax is correct. I think there shouldn't be ; before Category.


Sure, i can check that. Also qq, i saw this note in the documentation: "If you trigger a product-specific event by using the &&products variable, you must also set that event in the &&events variable. If you do not set that event, it is filtered out during processing"

 

I just checked with the iOS devs and they said they are not passing any &&events variable. Could this be an issue as well?