Skip to main content
Level 4
May 18, 2021 10:06 AM UTC
Solved

Classification in eVar

Hi Team,

 

I am using s.product string to capture the product details. I am capturing the primary category in evar16 and 17. I am using the below code to capture the data:

 

 

So, now if multiple product is added in the cart, then multiple values in coming in the report, so can I resolve the issue through classification.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
PratheepArunRaj
PratheepArunRajAccepted solution
Adobe Champion, Community Advisor, UG Leader
May 19, 2021 2:28 AM UTC

Dear Bindu,

Sorry, Classification is not the solution for your use case.

Guess, rather than capturing the products in the syntax below

s.products = "Category1;Product1;;;;eVar14=Value1|eVar17=Value1,Category2;Product2;;;;eVar14=Value2|eVar17=Value2,Category3;Product3;;;;eVar14=Value3|eVar17=Value3,";

you are capturing it as

s.products = "Category1,Category2,Category3;Product1,Product2,Product3;;;;eVar14=Value1,Value2,Value3|eVar17=Value1,Value2,Value3";

So, you need to have a proper syntax on your product string and that will resolve your issue.

Thank You, Pratheep Arun Raj B | Xerago | Terryn Winter Analytics

PS: I have bolded few values so that you can understand the difference due to multiple products.

Thank You, Pratheep Arun Raj B (Arun) | Xerago | Terryn Winter Analytics

17 replies

yuhuisg
Community Advisor
Community Advisor
May 18, 2021 10:45 AM UTC

I think your code is wrong.

You're resetting s.products with each item in your shopti_data_layer's products array. What you should be doing is to append each item to s.products.

So something like this:

s.products = ""; for (var i=0; i < window.shopti_data_layer.products.length; i++) { var product = window.shopti_data_layer.products[i].category + ";" + [rest of the product's data and eVars to be tracked]; s.products = s.apl(s.products, product); }
Translate
Level 4
May 18, 2021 11:32 AM UTC
@yuhuisg, it is not resetting basically, when user is adding multiple products in cart, then evar16 and evar17 is storing multiple categories in it. how we can avoid this?
Translate
khurshid
Adobe Employee
Adobe Employee
May 18, 2021 6:18 PM UTC

Yes you can use classification to resolve this.

Translate
yuhuisg
Community Advisor
Community Advisor
May 19, 2021 1:43 AM UTC
Which eVar does your freeform table screenshot refer to?
Translate
PratheepArunRaj
Adobe Champion, Community Advisor, UG Leader
PratheepArunRajAdobe Champion, Community Advisor, UG LeaderAccepted solution
Adobe Champion, Community Advisor, UG Leader
May 19, 2021 2:28 AM UTC

Dear Bindu,

Sorry, Classification is not the solution for your use case.

Guess, rather than capturing the products in the syntax below

s.products = "Category1;Product1;;;;eVar14=Value1|eVar17=Value1,Category2;Product2;;;;eVar14=Value2|eVar17=Value2,Category3;Product3;;;;eVar14=Value3|eVar17=Value3,";

you are capturing it as

s.products = "Category1,Category2,Category3;Product1,Product2,Product3;;;;eVar14=Value1,Value2,Value3|eVar17=Value1,Value2,Value3";

So, you need to have a proper syntax on your product string and that will resolve your issue.

Thank You, Pratheep Arun Raj B | Xerago | Terryn Winter Analytics

PS: I have bolded few values so that you can understand the difference due to multiple products.

Translate
Thank You, Pratheep Arun Raj B (Arun) | Xerago | Terryn Winter Analytics
Level 3
May 19, 2021 5:25 AM UTC
@pratheeparunraj but I am using data layer to populate the same, then how can I use the above syntax, can you give me working example.
Translate
Level 3
May 19, 2021 5:26 AM UTC
@yuhuisg, it is evar16
Translate