Expand my Community achievements bar.

SOLVED

Is This a Case for Merchandising Evars?

Avatar

Level 3

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)

 

CategoryIDAction
Apples123Add
Banana000 
Apples456Add
Oranges456Add
Apples012Add

 

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 ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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)

Jennifer_Dungan_0-1702441464780.png

 

 

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)

View solution in original post

13 Replies

Avatar

Community Advisor

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

Avatar

Community Advisor

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:

  • Apples|123
  • Bananas|000
  • Apples|456

 

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:

  • Apples
    • 123
    • 456
  • Bananas
    • 000

 

In your case, you probably don't need merchandising eVars and events (unless your description was simplified)... and this should achieve what you need...

Avatar

Community Advisor

@Jennifer_Dungan That was so well detailed out ! Only limitation might be listvars being 3 ? 

Avatar

Community Advisor

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.

Avatar

Community Advisor

That's pretty cool. You should write a blog post on this one may be. This scales so well in many scenarios.

Avatar

Community Advisor

There may already be a blog from someone else, but it wouldn't hurt to back that up

Avatar

Level 3

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

 

Avatar

Community Advisor

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

 

Avatar

Level 3

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,

 

Avatar

Community Advisor

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)

Avatar

Correct answer by
Community Advisor

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)

Jennifer_Dungan_0-1702441464780.png

 

 

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)

Avatar

Level 3

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

Avatar

Community Advisor

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