Mechandising evar | Community
Skip to main content
New Participant
March 18, 2022
Solved

Mechandising evar

  • March 18, 2022
  • 2 replies
  • 1344 views

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 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Alexis_Cazes_

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

 

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

2 replies

Alexis_Cazes_
Alexis_Cazes_Accepted solution
New Participant
March 21, 2022

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

 

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

RimmAuthor
New Participant
March 21, 2022

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

Alexis_Cazes_
New Participant
March 23, 2022

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=en

 

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 .

Pablo_Childe
New Participant
March 18, 2022

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