Developer forum

Forum » Ecommerce - Standard features » Google Analytics and tax

Google Analytics and tax

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

In the Receipt template in Swift (v1 and v2) I see code like this:

value: @GetDouble("Ecom:Order.Price.Price.Value").ToString("0.00", System.Globalization.CultureInfo.InvariantCulture),
tax: @GetDouble("Ecom:Order.Taxes.Total.Price.Value").ToString("0.00", System.Globalization.CultureInfo.InvariantCulture),
shipping: @GetDouble("Ecom:Order.ShippingFee.Price.Value").ToString("0.00", System.Globalization.CultureInfo.InvariantCulture),

For the tax value, is this intentional? It seems to pick up only Tax lines. Is VAT not relevant here?

Imar

 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

And furthermore, since a Tax line is not excluded from the code that loops over the lines, it's included again. Is that OK? I.e.

gtag("event", "purchase", {
 transaction_id: "ORDER123",
 value: 409.15,
 tax: 2.95,
 shipping: 0.00,
 currency: "EUR",
 items: [
 {
 item_id: "Item123",
 item_name: "Name here",
 currency: "EUR",
 price: 137.14,
 quantity: 1.00
 },
  ... Other products here
 {
 item_id: "",    // This is the tax line
 item_name: "",
 currency: "EUR",
 price: 2.95,
 quantity: 1.00
 },
 ]
});
 
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Imar

I think you might be right. Depending on where you read and what you want to track...

Ecom:Order.Price.Price.Value

Could include VAT. That value reacts on the purchase is with or without VAT.

I think we probably should track prices without vat explicitly (as that seems to be the recommendation by Google), have the tax part of the event include vat and any tax (e.g. US sales tax or EU other kind of tax) and tax lines should not be in the lines loop.

Any tracking experts that can chip in?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yeah that sounds right. For the total order value Google says to exlcude tax (https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#purchase) so I assume that applies to the line items as well. Then tax should be the sum of all VAT and tax lines, and the item loop needs to be updated to exclude tax (and maybe other?) lines.

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Further to this: since the discount value is now included in the item, should product discount lines also be ignored in addition to tax lines?

 

You must be logged in to post in the forum