Expand my Community achievements bar.

SOLVED

Mechandising evar

Avatar

Level 1

Hi

I have a question about merchandising evar. i want to implement a merchandising evar (evar100) and i would like to know what kind of separator can i use to separate different value in the same evar. to explain, my evar100 will contain 2 different values for the same product (evar100 = x,y) what separator can i use to separate those variables without breaking sproduct structure ? 

Thank you in advance. 

Have a nice weekend

Rim 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I believe you make reference to the Merchandising eVar using product syntax: https://experienceleague.adobe.com/docs/analytics/components/dimensions/evar-merchandising.html?lang...

 

// This merchandising eVar uses conversion variable syntax, and counts an instance.
// However, if the binding event and products variable are not both set, the instance attributes to "None".
s.eVar1 = "Tower defense";

// This merchandising eVar uses product syntax, and does not count an instance.
s.products = "Games;Wizard tower;;;;eVar2=Tower defense";

 

So based on this you need to make sure to avoid any character that are used in the s.products syntax:

avoid:

  • ; as it delimits the product sections (product catefory;product sku;)
  • , as it delimits each product description
  • | as it delimits multiple value for some placeholders
    • Events (optional): Events tied to the product. Delimit multiple events with a pipe (|). See events for more information.
    • eVars (optional): Merchandising eVars tied to the product. Delimit multiple merchandising eVars with a pipe (|). See merchandising eVars for more information.

If you are using conversion variable syntax this does not really matter

View solution in original post

4 Replies

Avatar

Community Advisor

Since you are setting a new evar s.product info should not be affected all its components will capture as is.

The new evar in such situation where you basically want to add multiple extra variables, I do the following.

In your page code setup a string object. let id be dynamically populated by "x" and "y" variables. Since you are creating a string variable the contents can be what ever is easier for you.

can then be "," or "|" basically whatever delimiter makes your reporting easier.

 

One thing to remember is evar setting is important so if there are multiple products potentially viewed make sure you have a logic where next product overwrites the previous etc. So evar can follow users behaviours page to page even in same session.

 

GLTU

Avatar

Correct answer by
Community Advisor

I believe you make reference to the Merchandising eVar using product syntax: https://experienceleague.adobe.com/docs/analytics/components/dimensions/evar-merchandising.html?lang...

 

// This merchandising eVar uses conversion variable syntax, and counts an instance.
// However, if the binding event and products variable are not both set, the instance attributes to "None".
s.eVar1 = "Tower defense";

// This merchandising eVar uses product syntax, and does not count an instance.
s.products = "Games;Wizard tower;;;;eVar2=Tower defense";

 

So based on this you need to make sure to avoid any character that are used in the s.products syntax:

avoid:

  • ; as it delimits the product sections (product catefory;product sku;)
  • , as it delimits each product description
  • | as it delimits multiple value for some placeholders
    • Events (optional): Events tied to the product. Delimit multiple events with a pipe (|). See events for more information.
    • eVars (optional): Merchandising eVars tied to the product. Delimit multiple merchandising eVars with a pipe (|). See merchandising eVars for more information.

If you are using conversion variable syntax this does not really matter

Avatar

Level 1

Hi Alxis, thank you for your answer. if i understood correctly, i have to avoid "|", ";" and "," .

i will use an other kind of separator maybe "+" to combine my data on this merchandising evar.

Have a nice day. 

Rim

Avatar

Community Advisor

I was going through the documentation of s.products today and I found the official part that explains what not to include in s.products: 

https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=e...

 

IMPORTANT

Strip all semicolons, commas, and pipes from product names, categories, and merchandising eVar values. If a product name includes a comma, AppMeasurement parses it as the start of a new product. This incorrect parsing throws off the rest of the product string, causing incorrect data in dimensions and reports.

 

So it aligns to what I advised .