I have an evar that has the product type(s) being purchased on a comma-delimited basis.
ex:
We only have 6 types of products, but several thousand permutations of this eVar and the corresponding orders with it.
Is there a way to split out the variable by the delimiter and then have adobe count the products ordered?
Views
Replies
Total Likes
Can I ask why you are trying to do this with an eVar instead of the Products List which is designed to pass multiple products with their own contextual merchandising eVars?
I can think of no way to properly split an eVar to get you what you want (short of taking it outside of Adobe, and processing it with another tool).
However, using Products List will do exactly what you want without trying to do a solution after the fact.
The notation of Products List for each item is:
category; product identifier; quantity; price; merchandising events; merchandising eVars
Each item should be separated by a comma delimiter... think of this as a list of lists.
Quantity and Price only apply when the "purchase" event is present on the call, but you cannot access these independently.. these build the revenue metric (quantity multiplied by price). So if you want an item count you can use, I would use a numeric event as well in the notation (see below). All of the fields are technically optional except for the product identifier...
For more info see:
https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/page-vars/products
So let's look at a simple example, just the products, and I am going to use event1 as my "items count"
Your first example: prodA,prodB
s.events = "event1";s.products = ";prodA;;;event1=1,;prodB;;;event1=1";
This will count prodA once, and prodB once... if this were a purchase event, I might update it to something like this:
s.events = "event1,purchase";s.products = ";prodA;1;9.99;event1=1,;prodB;1;4.99;event1=1";
Now, let's look at your second example: prodB,prodB,prodB
to something like this:
s.events = "event1";s.products = ";prodB;;;event1=3";
This will count prodB three times.
Now, let's take this a step farther, let's say the you want to track some extra info about your products... like maybe you need to track the type and the colour. I am going to assume that "prodB" is a SKU and therefore has a specific designation for each colour. eVar1 will be the type, and eVar2 will be the colour.
s.events = "event1";s.products = ";prodA;;;event1=1;eVar1=t-shirt|eVar2=red,;prodB;1;4.99;event1=1;eVar1=pants|eVar2=black";
When you break your products down by the eVars, "t-shirt" will only map to prodA (not to prodB), the same with "red", it only applies to prodA... and pants/black will only map to prodB
While these are eVars, once you turn these into Merchandising eVars the context of the specific product they are paired to applies.
Views
Replies
Total Likes
Thanks - we pass it through this way because of legacy "that's how it's always been done." It's also passed it through from tealium to an in-house system where obviously this can be wrangled via sql, etc.
But they never stood up s.products properly when implemented (before my time).
I see..
The problem is that eVars really aren't set up for this type of processing... and while you could use one of your three List Variables, the problem is that duplicates are removed.... so sending "prodB,prodB,prodB" would result in a single "prodB"....
You could try to add a prefix to make each value "unique" such as "1:propdB,2:prodB,3:prodB"... then use classifications to remove the prefix...
But it would still be in your best interest to look at s.products... even if it means having to redesign your tracking... you could try to keep both values... the "simple version" for tealium.. and the s.products for Adobe?
Views
Replies
Total Likes
Views
Like
Replies
Views
Like
Replies
Views
Likes
Replies