Web Pixels API checkout_completed subtotal field including taxes and shipping

Per the documentation here https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed I am expecting that checkout.data.subtotalPrice.amount would never include taxes, shipping charges, or duties. It appears that sometimes it is including shipping and taxes and is causing error in GA4 reporting. There is also ambiguity when it comes to how the subtotalPrice is calculated and how it responds to line-item discounts.

Any information on how to understand the subtotalPrice field more accurately? We prefer to track subtotal rather than total

Hi scalemind,

Thanks for your query.

IF your datalayer is don’t offer that feature you can not avail that.

couple of days ago one of my clients reached out to me to track the purchase value without shipping and tax. and I configured the datalayer that way.

IF you see the data layer value is calculated by subtracting the tax price and shipping price.

Feel free to ask if you have any questions.

Thanks