using appMeasurement here and I have a challenge on a page where I need to correlate two varied dimensions to an event
Let's say for example that we have a list on the page with multi-selection boxes (add) as in the table below. Here we have four items selected and being added at once (one button to submit all adds)
Category | ID | Action |
Apples | 123 | Add |
Banana | 000 | |
Apples | 456 | Add |
Oranges | 456 | Add |
Apples | 012 | Add |
I could put both the Category and ID into two ListVars, but upon breaking down in reporting, I don't think they would end up being correlated, that ID 456 has one "add" each for Apples & Oranges
Should this be solved by putting Category into a product string with the ID as a merchandising Evar ?
Solved! Go to Solution.
Views
Replies
Total Likes
Sorry for getting back to this so late...
Like you, I was unable to get a proper count for duplicated items in the list... so the only way I know how to deal with tracking this is to use your s.products to pass the values. However, I would pair this with a numeric merchandising event.
So for example, the product list notation is:
category;product;quantity;price;merch events;merch eVars
If you are using s.products for other items, I would even considering using the "category" here, not to identify "apples" or "bananas", but rather to denote this use from others (we use our products list for about 20 different things, I use the category to specify each "use", then use the products or merchandiing eVars as the actual data)
Let's assume s.products is being used already, so we will make use of the category to denote the usage (i.e. "fruit")
We'll use the product id for the actual fruit id.
We'll set up a merchandising eVar as the "category" (apple, banana, etc)
We'll set up a second merchandising eVar as the "type" (soda, pie, etc)
And we'll configure a numeric event (not a counter)
When you track your data
1|apple|pie,
2|orange|soda,
2|orange|soda,
It will look like this:
s.events = "event1";
s.products = "fruit;1;;;event1=1;eVar1=apple|eVar2=pie,fruit;2;;;event1=2;eVar1=orange|eVar2=soda"
So you will increment "1|apple|pie" once, and "2|orange|soda" twice
There are no quantity/price values here, since this isn't a purchase event.... and it's weird, but you need to also set the event into your s.events (just not numerically incremented) for the events to count.
Now, you can use event1 (or whatever your actual event is), with your eVars to see 1 or 2, etc for the usage.
*** Updated Dec 22, 2023 - fixed the mixed up order of items in Products List as pointed out by @Alandy_Iceboats (apologies for that)
Views
Replies
Total Likes
Hey @Alandy_Iceboats
Your understanding is correct. To have a corelation so to speak, you can try out merch eVar as you mentioned. The challenge with the list variable is also something you've articulated.
Cheers,
Abhinav
Views
Replies
Total Likes
I use the Product String and merchandising eVars in our implementation (what I would give for multiple dimensions like this one)... as it stands, I use Product List for about 20 different uses...
However, depending on your complexity, you could use a single list var, using a notation that allows you to pass category and id as pairs, then use classification to split them out.
so something like:
"Apples|123,Bananas|000,Apples|456"
The list would use comma as the delimiter, resulting in rows like this:
Then you could use regex on your list to extract the Category and the Id into their own classifications.
Now you could pull out Category, and break down by ID:
In your case, you probably don't need merchandising eVars and events (unless your description was simplified)... and this should achieve what you need...
@Jennifer_Dungan That was so well detailed out ! Only limitation might be listvars being 3 ?
Views
Replies
Total Likes
True.. not everyone is in this situation, but I am starting to use one "generic list" adding in a classification prefix so that I can use one list for multiple purposes...
So in the example above, I would add additional info like:
"sb|Apples|123,sb|Bananas|000,sb|Apples|456"
Where "sb" is "selection box" or something like that... so then I only process items starting with "sb" into Category and ID....
I don't need "sb" to be classified, it's only used by my regex rules to identify which classifications should occur.
Then I may have other items in the same list like:
"ou|value1|something|third-value,ou|value2|something2|third-value2"
Where "ou" in this case is "Other Use", and "ou" actually has three values being passed and parsed...
This does require a re-design of lists, if all three lists are currently in use.... but if there is a free list var, this can be started and build it into a future "multiple" usage design.
That's pretty cool. You should write a blog post on this one may be. This scales so well in many scenarios.
There may already be a blog from someone else, but it wouldn't hurt to back that up
Thanks @Jennifer_Dungan
Missing from my table above is the case where a category/id can be duplicated in the list
Since List Vars dedupe, I wouldn't get an accurate count in that case
I pushed in some sample data with classifications as illustrated and it worked as expected, except I had fewer unique results (10) than the original string (15) I put in as
id|category|type
1|apple|pie,
2|orange|soda,
2|orange|soda,
3|orange|soda,
3|orange|juice,
3|banana|split,
4|banana|just a banana,
4|banana|just a banana,
4|orange|juice,
4|orange|juice,
5|orange|soda,
5|banana|just a banana,
5|banana|just a banana,
5|apple|pie,
5|apple|pie
Views
Replies
Total Likes
You could and and instance id to each item to prevent the de-duplication, then again just not use it when you process your classifications....
so instead of "id|category|type", use "instance|id|category|type"
The instance or index can even be a simple index for every item in the list:
1|1|apple|pie,
2|2|orange|soda,
3|2|orange|soda,
4|3|orange|soda,
5|3|orange|juice,
6|3|banana|split,
7|4|banana|just a banana,
8|4|banana|just a banana,
9|4|orange|juice,
10|4|orange|juice,
11|5|orange|soda,
12|5|banana|just a banana,
13|5|banana|just a banana,
14|5|apple|pie,
15|5|apple|pie
now there is no duplication, each item is unique..
Yes. This worked to individuate the items in the list, ignoring the serialization applied with the index # of the item. I definitely learned a trick here
Unfortunately, the events didn't sum. So, where there were duplicates, we get a sum of 1 for the events sent along with the hit
These items from the above for example results in 1 row with a sum of 1 for event99
2|2|orange|soda, 3|2|orange|soda,
Views
Replies
Total Likes
ok, let me play with this a bit... I will need to use a demo site to pass some duplicates (not of my lists in production do)
Views
Replies
Total Likes
Sorry for getting back to this so late...
Like you, I was unable to get a proper count for duplicated items in the list... so the only way I know how to deal with tracking this is to use your s.products to pass the values. However, I would pair this with a numeric merchandising event.
So for example, the product list notation is:
category;product;quantity;price;merch events;merch eVars
If you are using s.products for other items, I would even considering using the "category" here, not to identify "apples" or "bananas", but rather to denote this use from others (we use our products list for about 20 different things, I use the category to specify each "use", then use the products or merchandiing eVars as the actual data)
Let's assume s.products is being used already, so we will make use of the category to denote the usage (i.e. "fruit")
We'll use the product id for the actual fruit id.
We'll set up a merchandising eVar as the "category" (apple, banana, etc)
We'll set up a second merchandising eVar as the "type" (soda, pie, etc)
And we'll configure a numeric event (not a counter)
When you track your data
1|apple|pie,
2|orange|soda,
2|orange|soda,
It will look like this:
s.events = "event1";
s.products = "fruit;1;;;event1=1;eVar1=apple|eVar2=pie,fruit;2;;;event1=2;eVar1=orange|eVar2=soda"
So you will increment "1|apple|pie" once, and "2|orange|soda" twice
There are no quantity/price values here, since this isn't a purchase event.... and it's weird, but you need to also set the event into your s.events (just not numerically incremented) for the events to count.
Now, you can use event1 (or whatever your actual event is), with your eVars to see 1 or 2, etc for the usage.
*** Updated Dec 22, 2023 - fixed the mixed up order of items in Products List as pointed out by @Alandy_Iceboats (apologies for that)
Views
Replies
Total Likes
So, the answer is yes
This type of solution requires merchandising evars. I was hoping not to involve the product string, let alone merch vars
Having set these as using the product syntax above and numeric events (I decided to allow duplicates in the list, they still sum), I was able to get predicted results
Pointing out that in the solution above the merch evars & events are out of order. Should be "category;product;quantity;price;merch events;merch eVars" as documented here: https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/evar-merchandising.h...
Thank you Jennifer for helping to contribute to the solution
Views
Replies
Total Likes
Ha you are right.. I think it was late when I wrote that, I will go back and edit that soon.
The problem with numeric events alone, is that each item doesn't get a value on it's own:
s.list1 = "item1,item2,item2,item3"
s.events = "eventx=4"
Is that in your report:
EventX
List 4
item1 4
item2 4
item3 4
Which I don't think is the desired result....
Using a separate numerical event will only work if you are only passing one type of item at a time, in multiples:
Hit 1 - Item1 (x1) / eventx = 1
Hit 2 - Item2 (x2) / eventX = 2
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies