Clarification between subtotal and revenue

I’m reviewing the Zaraz Ecommerce documentation and came across the variable definitions. I found the explanations a bit confusing and was wondering if anyone can confirm whether my definitions match the intended behavior:

Subtotal: Price of all goods/services - discount
Total: Price of all goods/services + taxes + shipping - discount
Revenue: Price of all goods/services - discount

Alternatively, Revenue can be: Total - taxes - shipping

Based on this example, I assume subtotal and revenue are the same?


There is no subtotal parameter, there is a “value” parameter that is only used at product scope.

Total = sum of products revenues (price * quantity)
Revenue = Total - shipping - tax

Do you use / implement a specific tool for e-commerce tracking? Zaraz tries to offer a unified e-commerce tracking API but different be dors have different taxonomy and some parameters are better used on specific vendors.

Thanks for the reply, I really appreciate it. I don’t know where I got subtotal, but you’re right, it’s not even in the documentation. I have my own tool for e-commerce tracking, but I would like to use Zaraz to push data to Google Ads, Bing, and Facebook.

It sounds like we have the same understanding of Revenue, but for whatever reason I wanted to check on Segment’s definitions (because Zaraz integrates with them). Here are Segment’s and Cloudflare’s definitions of Revenue:

Segment: “Revenue ($) associated with the transaction (excluding shipping and tax)”
Cloudflare: “Revenue excluding shipping and tax.”

These sound identical, right? So they should follow the same logic to in each example. Wrong.

In Segment’s example, it’s pretty explicit that Revenue is simply price * quantity for each product sold. Discounts are NOT factored into this number.

Zaraz’s Order Completed example is a bit more ambiguous. But by following Segment’s logic to calculate Revenue, it should be $30 (102+52). However, Zaraz’s example lists Revenue as $25.

Am I just going crazy? Why is there discrepancy?

Thanks for pointing out this discrepancy in the doc!

From what I see in the code for GA managed components, discount should be factored in the revenue calculation. I feel also that the example in the documentation is wrong, it should be 30 - 2 (tax) - 3 (shipping) - 5 (discount) and give 20 instead of 25.

So Revenue in Zaraz e-commerce equals:

Total - tax - shipping - discount.

Interesting, are you suggesting that Segment and Zaraz are both wrong in their documentation?

It would be great to get clarification from the Zaraz team on this issue. Cleaning up the definitions for some of these variables would prevent a lot of confusion.