Expand my Community achievements bar.

Join us at Adobe Summit 2024 for the Coffee Break Q&A Live series, a unique opportunity to network with and learn from expert users, the Adobe product team, and Adobe partners in a small group, 30 minute AMA conversations.
SOLVED

Split ab=3|cd=1|ef=1 in separate events (Processing Rules possible?)

Avatar

Level 4

Hi community, 

I have a client that would like to count how many search results are the users getting, by they would like to count them by category. For example, if user gets 20 results, we would get something like:

  • Category 1: 13 results
  • Category 2: 3 results
  • Category 3: 4 results

We are thinking in having an event of type counter for each category. But the thing is more categories would be created in future.

It's ok from our side to create new events every time they add a new category. But we would like to avoid changes in site code for assigning new events. Based on that, we tought in the option of sending all categories and values in a single eVar, then process it ans assign events using Processing Rules.

Is is possible? Do we have something like split funtion un Processing Rules? Any other option?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 4

You mean having 1 eVar for "category" and 1 event for "counter":

  • eVarXX: Results Categories
  • eventYY: Results Counter by Categories

So, we could display like this:

eVarXX eventYY
Category 1 25
Category 2 12

 

Ps: I created the first parte of this response before. But now I've realized it wouldn't work, because I need to take the value for each category and increasing counter for each one. I mean if:

  • At <T>: {Cat1=10, Cat2=15, Cat3=20}
  • On new user visit: {Cat1=2, Cat2=0, Cat3=5}
  • At <T+1>: {Cat1=12, Cat2=15, Cat3=25}

View solution in original post

12 Replies

Avatar

Community Advisor

I do something similar, I set an eVar or prop with search result data (search result page|number of results|number of results per page|sort order), then I use a classification rule to split these values into separate dimensions... Processing Rules is good to concatenate values, not parse them. You could in theory look for "IF contains value Category 1 then set eventX"; but I'm not sure if this is the best approach....

 

I'm not sure why you would need an event per category? What are you trying to capture with the event? That a search was performed that returned data in that category?  So IF you "have" a category 4, but it didn't surface in the results then you wouldn't have a "search results event" for category 4?

 

Why not have 1 event "search result page", then use a classification to split the results per category. If there is no value for Category X in the results, it wouldn't apply to that classification. Then you won't be going through tonnes of events that all perform the same basic function.

Avatar

Correct answer by
Level 4

You mean having 1 eVar for "category" and 1 event for "counter":

  • eVarXX: Results Categories
  • eventYY: Results Counter by Categories

So, we could display like this:

eVarXX eventYY
Category 1 25
Category 2 12

 

Ps: I created the first parte of this response before. But now I've realized it wouldn't work, because I need to take the value for each category and increasing counter for each one. I mean if:

  • At <T>: {Cat1=10, Cat2=15, Cat3=20}
  • On new user visit: {Cat1=2, Cat2=0, Cat3=5}
  • At <T+1>: {Cat1=12, Cat2=15, Cat3=25}

Avatar

Level 4

Hi Jennifer,

I created Classification Rule as below:

Screen Shot 2022-11-22 at 9.08.15 PM.png

 

What is next step?

  • Where those "$1" values are stored?
  • I used "evar104" in "Select Report Suites and Variables". Does it mean "eVar104" value will be overwrited with those new values?
  • Can I use new values to assign them to an event like "eventXX=N", "eventYY=N", "eventZZ=N"?

Avatar

Community Advisor

You are close, but you actually need to set up a classification for each category. So you can't use "Test Regex" over and over again... 

 

Instead you would set up classification "cat 1" and another classification "cat 2" and another classification "cat 3"

So when this rule runs, lets say your evar is "Cat1=10, Cat2=15, Cat3=20"

Your first regex would extra "10" and set it into classification "cat 1", and then extract "15" and set into "cat 2" and then extract "20" and set into "cat 3"

But your dimension would be your values, not the event, the event would track the occurrences "1" for each of these. 

 

 

When you create classifications, they are basically "sub-values" of your original eVar (evar104). So the eVar will always stay "Cat1=10, Cat2=15, Cat3=20" and the subs would store the values as you extracted and set them.

 

 

You cannot set events with classifications... and while you can set events with processing rules (you cannot extract values)... IF you really need the event to be the value ("10", or "15" or "20") you need to set up individual events, and set them in your code to be the correct values....  (those events need to be Numeric events - as seen in my other post)

Avatar

Community Advisor

You can consider using list props https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/prop.html?lang=en#li...

With list props, you can send a delimited string to AA, then AA will split that into the individual values in the prop's report.

So if you want to track:

  • Category 1: 13 results
  • Category 2: 3 results
  • Category 3: 4 results

You could use the following (assuming you've configured prop12 as your list prop, using "," as the delimiter):

s.prop12 = "Cat1:13,Cat2:3,Cat3:4";

The resulting report would look like this:

prop12 Occurrences
Cat1:13 1
Cat2:3 1
Cat3:4 1

You can then use Classifications to further separate the Category from the Results count, as Jennifer had suggested.

The biggest disadvantage with this approach is that your delimited string has a 100-character limit, as all props do. If you need to track longer strings, you can use list eVars https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/list.html?lang=en, but every report suite has a hard limit of 3 list eVars only.

Avatar

Level 4

The thing is we need would like to count how many results of each type are displayed to user and it's accumulative. For example, if User1 gets "Cat1:13,Cat2:3,Cat3:4" and User2 gets "Cat1:10,Cat2:5,Cat3:0". After those visits, we will have:

  • Cat1 = 23 (13 + 10)
  • Cat2 = 8 (3 + 5)
  • Cat3 = 4 (4 + 0)

Avatar

Community Advisor

Ok, so you can't use a "counter" event if you are trying to actually use the event to represent the values of the results.. a "counter" event will count the occurrences. 

 

If you really need the event counter to count the values, there is no way around setting up a unique event for each category, setting them up as "Numeric events", and setting the values as:

 

s.events="event1=10,event2=5" etc

 

Numeric events you can pass how much to increment the event by.

 

But this is going to be hard to maintain, and use up a lot of your events.

Avatar

Community Advisor

An alternate, if you don't mind taking the data out of Adobe Workspaces, you can use the classification method, and pull the data out to Excel using Report Builder.... then you can convert the "text" of the values into numbers, and pull them together using a pivot table?


This would allow you to keep your tagging minimal, and be able to set up new classifications as needed (with the look back window of up to 6 months, you don't have to set them up as soon as a new Category is created), and you don't have to instruct your developers to add new events to the implementation each time....

Avatar

Level 4

No, Excel is not option.

Looks like there are no other options. We wanted to avoid changes in code in future, but looks like it wouldn't be possible.

Avatar

Community Advisor

Right, as I said, it was an option, but it might not work for you

Avatar

Community Advisor

Yes, sounds like you're out of options, then.

One thing to keep in mind: all values that are tracked with props and eVars are always strings. So even if you track a number 12 to an eVar, it gets set as the string "12", and there's no way to convert it back to a number that can be used as a metric, even if you and I and everyone else knows that it's a number.

Avatar

Community Advisor

There is another "crazy" option....

 

However, if you are using your s.products as intended you may not want to do this, or do so carefully.

By  it's very nature, s.products allows you to explicitly set events in conjunction with values, that only count against those values.

 

You could use this to create a category / event pairing so that you can use only one event.

 

s.products format is: 

category;product name;quantity;price;merchandising eVar;merchandising events

 

Essentially, you would use:

s.events="event1";

s.products="search;category 1;;;;event1=20,search;category 2;;;;event1=5";

 

If you were to look at event1 in isolation, it would show 25, but if you break it down in a table like the following:

 

                                                           event1

search*                                               25
      Products**                                    25

           category 1                               20
           category 2                               5



* (pull in the explicit "search" value from the category dimension)

** (pull in products it self as a breakdown dimension - only products using "search category will show)

 

Each category (as product), will count the values as passed (event1 in this case is still a Numeric Event).

 

 

The problem with this method is IF you are using your s.products for actual product/cart/conversion flows... these values will be harder to exclude.... but I thought it was still worth mentioning.

 

I actually do this, I use s.products for about 20 different things (as it's the only one that allows me to explicitly connect events to individual values in a multi-value setting).. but it comes with it's own set of challenges.