eVar as a metric




We have a requirement where we need to track number of add-ons made on top of a room booking (  add-ons are something like breakfast, car park etc.)

There can be multiple quantities of add-on in a single booking ( for ex, 2 breakfasts and 1 car park. so total of 3). When we used event, it didnt work as it's a counter(It showed quantity as 1). We also tried with numeric event but it still didn't work.

A workaround that we did was to get the quantity value in an eVar( got the qty value from Data layer)

Now for consumption of reports, we would need to put add-on names in rows and addon revenue, addon quantity in columns. Since addon qty is an eVar here, we thought of creating a metric with eVar. However, eVars can be used only as segments in metrics and not as a metric, although events can be made into metrics.

How do we solve this?

Appreciate any help.

Accepted Solutions (1)

Accepted Solutions (1)




you can do some calculation with evars, it was proven by the last "analytics idols contest". see video here: Adobe Summit 2018 | The Digital Marketing Conference | March 25—29, 2018

in short you have to do the following steps

  1. create new segments based on the values from the evar:
  2. create calculated metric an multiply each segment (with "page views") to the desired number, all summed up
  3. Use new metric as new metric in reports

a bit of work but since the additional items in this case might be just a few one, you only have to create those few segments and sum them up

Answers (3)

Answers (3)




1. I thought about same solution not so long ago, based on eVar values create a metric. Not possible at all.

It needs to either send as an event or use processing rule to increment an event by this value.

2. it is possible to send counter and numeric events to increment by more than one. doc

3.The products variable allows you to send additional events in the products variable itself which ties these events to only the specific product. Really useful if you want to send let say VAT for only this product and/or shipping cost for only this product.


Product-Specific Currency Events

If a currency event receives a value in the products variable instead of the events variable, it applies only to that value. This is useful to track product-specific discounts, product shipping, and similar values. For example, if you configured event 1 to track product shipping, a product with a "4.50" shipping charge might appear similar to the following:

  1. s.events="event1"

  2. s.products="Footwear;Running Shoes;1;99.99;event1=4.50"


class="p" style="color:rgb(75, 75, 75);font-family:AdobeClean;font-size:16px;background-color:rgb(245, 245, 245)"

  • s.products="Footwear;Running Shoes;1;69.95;event1=7.59"


Example 2: Multiple Numeric/Currency Events

  1. s.events="purchase,event1,event2"

  2. s.products="Footwear;Running Shoes;1;69.95;event1=7.59|event2=19.45"

Order-Wide Currency Events

If a currency event receives a value in the events list instead of the products variable, it applies to all products in the products variable. This is useful to track order-wide discounts, shipping, and similar values, without modifying the product price or by tracking it in the product list separately.

For example, if you configured event10 to contain order-wide discounts, a purchase with a 10% discount might appear similar to the following:

  1. s.events="purchase,event10=9.95"

  2. s.products="Footwear;Running Shoes;1;69.95,Running Essentials;Running Socks;10;29.50"

  3. s.purchaseID="1234567890"


On currency event reports, the report total represents the de-duplicated event total (in this example, the total amount of discounts during the reporting period), not the sum of the event values for each product. For example, you would see "9.95" listed for both "Running Shoes" and "Running Socks", and the total would also be "9.95".

Note: if a value for the same Numeric/Currency Event is specified in the products variable and in the events variable, the value from theevents is used.


So you have add-ons then you could do something like.

s.events="purchase,event1" //I make one booking

s.products=";double room;1;100;event1=1|event2=2|event3=3"

So per code above, I make one booking of a double room, with one parking add-on (event1) and 2 breakfast add-on (event2), so it gives me a total of 3 add-ons (event3).

You could as well omit event3 and simply do a calculated metric with sum of event1 and event2

report would be something like

Products     order     unit     revenue     Parking(event1)     Breakfast(event2)     Add-ons(event3)

double room     1          1          100          1                              2                              3

That is just an example of what you can do.


Now I am going to a bit deeper and do not know if it will totally work and how much work it will add but I think you could use a calculated metric based on the values in your evar to create a total for add on.

You can use IF-THEN function in a calculated metric, so you would be able to do something like



Container 1

IF evarx=1

THEN 1 >>

put a container and hard value 1




Container 2

IF evarx=2

THEN 2 >> put a container and hard value 2





I would not expect the add-ons to go over a specific value per bookings.

Just an idea but if you want to do with the data that you have then it is one of the solution - never tested it so.




just two ideas:

1) use the "products" functionality for the additional items with some identifier for easy split

2) you can change the event to a numeric event and increase this event by any number you want (not just by one). see here Configure Events

there are other options - it all depends on what you want to report at the end...