Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Classification in eVar

Avatar

Avatar
Validate 10
Level 1
bindukumari1990
Level 1

Like

1 like

Total Posts

47 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile

Avatar
Validate 10
Level 1
bindukumari1990
Level 1

Like

1 like

Total Posts

47 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile
bindukumari1990
Level 1

18-05-2021

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:

 

bindukumari1990_1-1621332386096.png

 

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.

bindukumari1990_0-1621331770209.png

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Seeker
Moderator
PratheepArunRaj
Moderator

Likes

309 likes

Total Posts

863 posts

Correct Reply

263 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Affirm 250
Contributor
View profile

Avatar
Seeker
Moderator
PratheepArunRaj
Moderator

Likes

309 likes

Total Posts

863 posts

Correct Reply

263 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Affirm 250
Contributor
View profile
PratheepArunRaj
Moderator

18-05-2021

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.

Answers (2)

Answers (2)

Avatar

Avatar
Affirm 25
Employee
Khurshid_Alam
Employee

Likes

55 likes

Total Posts

188 posts

Correct Reply

41 solutions
Top badges earned
Affirm 25
Boost 50
Affirm 10
Boost 25
Affirm 5
View profile

Avatar
Affirm 25
Employee
Khurshid_Alam
Employee

Likes

55 likes

Total Posts

188 posts

Correct Reply

41 solutions
Top badges earned
Affirm 25
Boost 50
Affirm 10
Boost 25
Affirm 5
View profile
Khurshid_Alam
Employee

18-05-2021

Yes you can use classification to resolve this.

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

183 likes

Total Posts

553 posts

Correct Reply

106 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

183 likes

Total Posts

553 posts

Correct Reply

106 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

18-05-2021

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);
}
bindukumari1990
@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?
yuhuisg
You're right, I misread your code and missed out that you're using "s.products += ...". I had read it as "s.products = ...".
yuhuisg
Can you copy-paste the full code? Your screenshot cuts off at the right part after "s.eVar14 = ", so it's not possible to troubleshoot.
bindukumari1990

@yuhuisg

s.products = "";
s.eVar14 = "";
s.eVar17 = "";
for(var i=0; i<window.shopti_data_layer.products.length; i++) {
//
s.linkTrackVars = "eVar14,eVar15,eVar16,eVar17";
s.eVar14 = window.shopti_data_layer.products[i].product_id ;
s.eVar17 = window.shopti_data_layer.products[i].product_sub_category;
//s.eVar15 += window.shopti_data_layer.products[i].name ;
//s.eVar15 = window.shopti_data_layer.products[i].name ;
//s.eVar16 = window.shopti_data_layer.products[i].product_category ;
// Add individual produ ct info to the product string
//s.products += window.shopti_data_layer.products[i].product_category + ";" + window.shopti_data_layer.products[i].name + ";" + ";" + ";" + ";" +s.eVar14 ;
s.products += window.shopti_data_layer.products[i].product_category + ";" + window.shopti_data_layer.products[i].name.replace(/,/g, "") + ";" + ";" + ";" + ";" + "eVar14=" + s.eVar14 + "|" + "eVar17=" + s.eVar17;
if(i != window.shopti_data_layer.products.length-1) {
s.products += ",";

}
}

Hope it s fine.

yuhuisg
@bindukumari1990 I don't see eVar16 being set in this code that you pasted here. Can you please verify that you've provided the actual code? It will be difficult to troubleshoot if you're not providing the code that is producing the resulting data in AA.