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
Views
Replies
Total Likes
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.
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
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
Hey @jaishal No, I don't think so, because only event will be filtered out in that case. So, I think the syntax would be the problem. But if your team has validated the same and you still see an issue, please feel free to log a support ticket to us and we can check this further. Please do include the verbose logs when creating a ticket and setup detals.
So to add onto this conversation... We are still using ACP SDK.
There is no processing rules for products, this is why your products need to be sent directly, but they absolutely need to be the correct format in order for Adobe to parse the information correctly... or the entire thing will be thrown out as invalid.
The format you see for Web is the format you should see in your app:
https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/page-vars/products
So:
;Category: infinite;Product: 160GB, Talk & Text - Plus;Quantity: 1;Price: 75.0
Is wrong for many reasons... first, it should not start with ; (that indicates that the category value is empy...but you are expecting your category to be "Category: infinite" (not sure if you want the literal "Category:" there... or maybe you are only adding it for readability here? But, if you are sending these prefixes, then this will cause some issues in your data).. and all other fields have been shifted by one place. Your Product Name is in the quantity slot, your quantity is in the price, your price is in your custom events....
You cannot have a comma in your Product Identifier like that... "Product: 160GB, Talk & Text - Plus", Products is a complex list... comma is the separator between products, semi-colon is the separator between the parts of the Product notation (category, product, quantity, price, merch events and merch eVars)... so that comma, placed where it is, is telling Adobe to move to the next product. The ampersand is also going to cause issues as this is a reserved character for saying "next param"... I believe both will need to be URL encoded.
Next, you cannot prefix your quantity and price with text like that.... only numerical values are expected here.
As for custom events, you aren't using any, but because this is a purchase, and quantity and price are only read by Adobe in the presence of the "purchase" event, even IF the above was well formed... you would only get the Category and Product, but no Revenue (which would be ignored without purchase).
based on your above, I would expect the final output to be something like:
&&product=infinite;160GB%2C Talk %26 Text - Plus;1;75.0&&events=purchase
(notice that I encoded both your comma and your ampersand to keep both of these from breaking the string - comma will break the way products processes the data, & will be treated like a whole new passed param)
I only passed the purchase event, but IF you had any custom events in the product notation, they would also need to be passed... something like:
&&product=infinite;160GB%2C Talk %26 Text - Plus;1;75.0;event1=1&&events=purchase,event1
Once you are sending the product information in the correct format, it will go straight into Adobe, there is no processing rules required.
I hope this helps, good luck
Thanks jennifer for the response.
In Adobe documentation https://developer.adobe.com/client-sdks/solution/adobe-analytics/product-variable/
It is said under Swift(iOS):
The documentation is actually correct... it's just that they left out the optional category.. hence starting with ; instead of text.
In your example, you are passing a category, so that needs to be the first value... but category is optional... in fact, everything except the Product Identifier is optional.
You will also notice that nothing in that notation has prefix text (same as the information I provided), my example is the same as the documentation, but with more of the optional fields provided to match up to your original ask
Going back to the documentation sample; when reading:
";Running Shoes;1;69.95;event1=5.5;eVar1=Merchandising,;Running Socks;10;29.99"
You would read this as:
Product 1:
Product 2:
When it comes to the optional field, Category is not mandatory, but I like it because I use Products list for 20 different things (not all related to purchases) due to the ability to have merchandising elements... I use Category to denote the use as opposed to an actual category for the product.... but in a simpler implementation like yours, I might use category for actual product related data.
Quantity and Price should only exist on a purchase (and even then, it's only needed IF you want your Revenue Report to work... you can make a purchase without these), and neither Merchandising Events or eVars are mandatory...
But if you are sending those values, they need to be formatted correctly, and sent in the proper notation.
Thanks for the response jennifer.
Also wanted to confirm if i want to get Product ID(SOC ID) as well along with category, product, category, price. How it needs to be parsed as it is available from an API respons.e
On web, we are getting this value this value under Products: IP16PM256GLD:iPhone 16 Pro Max 256GB Desert Titanium
How do we get this value in App under Products?
Views
Replies
Total Likes
So in Workspace, when you look at Products, are you seeing "IP16PM256GLD:iPhone 16 Pro Max 256GB Desert Titanium"?
If so that is just the Product Identifier (i.e. the second part of the products notation)
If that is the case, it looks like your implementation combined the "ID" and the "Name/Description" all into the Product Identifier, rather than using something like Merchandising eVars... Or is that the Merchandising eVar?
If you want something to match your website data, you should look at your website... the formatting is the same... it's just pushed slightly differently (using app coding and using &&products in the URL string)... but the actual data, that is the same.
Views
Replies
Total Likes
So yes that is correct, web does combine the ID and Product Name as you mentioned by providing the fix using Adobe Launch. but since we do not use adobe launch for App. My questions is to get the ID value in "&&products", what should be the format? Also is it something that needs to be passed in a new eVAR or can be passed in "&&products" itself?
Views
Replies
Total Likes
It can still be passed in Products the same way... except that your developers have to code it, you can't use Launch or processing rules to combine the values...
So you will have to document the exact formatting, and provide that to your app developers so that they can create the product identifiers the way you need them, and to add it to the Purchase event using the &&products.
So if you want IP16PM256GLD:iPhone 16 Pro Max 256GB Desert Titanium you will have to instruct your developers which fields to pull this data from, so that they can code:
contextData["&&products"] = "infinite;IP16PM256GLD:iPhone 16 Pro Max 256GB Desert Titanium;1;75.0"
Views
Replies
Total Likes