Technical issues

Shopify net revenue tracked slightly too low

Why your tracked revenue may differ slightly from your actual net revenue

When is this relevant for you?

Only if you use Shopify and sell products with different VAT rates — for example, groceries (7%) together with cooking accessories (19%), or books (7%) together with stationery (19%).

In this case, there may be a deviation of approximately ±0.5–2% from the actual net value, because we have to calculate using an average tax rate.

For everyone else: exactly zero deviation.


The problem: Shopify withholds the tax from us

Shopify provides us with certain data fields in the tracking pixel. According to the official Shopify documentation, the subtotalPrice field should contain the goods value before taxes and before shipping — exactly what we need. In practice, for many shops, it still includes the VAT. This is a known, open gap in Shopify — with no fix date.

What Shopify additionally doesn't give us: the tax broken down by products or separately for shipping costs. We only receive a single number — the total tax on everything combined.


Our solution

We calculate the net value ourselves — as accurately as possible with the available data:

Tax rate      = Total tax ÷ (Total revenue − Total tax)
Shipping tax  = Shipping costs × Tax rate
Product tax   = Total tax − Shipping tax
Net revenue   = Total revenue − Shipping costs − Product tax

Calculation example (shop with mixed tax rates):

A customer buys:

What Shopify gives us:

Total revenue (gross incl. shipping) €64.88
Shipping costs (gross) €4.90
Total tax (black box — everything combined) €9.41

What we calculate from this:

Tax rate (average) 9.41 ÷ (64.88 − 9.41) = 16.97%
Shipping tax 4.90 × 16.97% = €0.83
Product tax 9.41 − 0.83 = €8.58
Net revenue (tracked) 64.88 − 4.90 − 8.58 = €51.40

For comparison — the actual net value:

Olive oil net 9.99 ÷ 1.07 = €9.34
Frying pan net 49.99 ÷ 1.19 = €42.01
Actual net revenue €51.35
Deviation €0.05 = ~0.1%

In this example, the deviation is minimal. The more extreme the ratio between 7% and 19% products, the greater it becomes — but it always stays below 2%.

Shopware common problems

If spaces in the product name lead to duplication of product names in tracking

In tracking, the name assigned in the backend - "Article name" is always used.

Shopware 5:

I could imagine that this part here is causing problems:

{$productName = $sArticle.articleName}
{if $sArticle.additionaltext}
    {$productName = $productName|cat:' '|cat:$sArticle.additionaltext}
{/if}

located in custom/plugins/DtgsGoogleTagManager/Resources/views/frontend/plugins/TagManager/buy.tpl

If the Additionaltext is filled in, it will be appended with a space in between. Please ensure that the Additionaltext is not filled with special characters or spaces, otherwise these problems will occur. Of course, you can also adopt the file into your theme and completely remove that part there.


No data on Reload or Add To Cart

here in our demo shop:

https://ga4dev.codiverse.de/bekleidung/herren/9/artikel-mit-auswahl-konfigurator

view_item and add_to_cart are still correctly populated even after reload. I assume that in your shop the theme does not correctly pull our template file during the AJAX call. Especially important is the file custom/plugins/DtgsGoogleTagManager/Resources/views/frontend/plugins/TagManager/buy.tpl

This apparently is not being loaded correctly at the moment. You can easily see it by searching the source code with CTRL+F for the hidden fields it includes:

dtgsGtmArticleName

dtgsGtmArticlePrice

etc.

These are currently completely missing. If you include the file, it will definitely be fixed.


No “remove_from_cart” event in the Datalayer, as actually shown in the Codiverse documentation

The Codiverse plugin normally builds in the hidden fields dtgsGtmArticleNumber, dtgsGtmArticleName, dtgsGtmArticlePrice etc. via the file frontend/checkout/items/product.tpl, specifically the theme block "frontend_checkout_cart_item_delete_article" - see file: custom/plugins/DtgsGoogleTagManager/Resources/views/frontend/plugins/TagManager/checkout_product.tpl

This does not seem to happen in the customer's custom theme, which is why no Remove_from_cart is triggered.

Either provide the block in the theme or - since you may have already heavily customized the theme - simply build in the hidden fields from the mentioned file yourself, then it should work.


Loading time is slow and is slowed down by “Google Tagmanager” and other Google tools (according to pagespeed.web.dev or another tool)

In advance: Don't worry 🙂 No problem.

Shoplytics® is designed for load-time-optimized integration of the entire tracking system.

Note:

The following optimization is only possible for Shopware 6…


—--------

CAUTION IN ADVANCE: After you implement the following changes, you must urgently and immediately notify technik@shoplytics.de

Without the following email to our tech team, tracking will otherwise remain completely deactivated…..

Simply write the following text in the email:

Subject: Shopware Loading Time Optimization activated

Email text:

Hi shoplytics® Tech Team,

please make all changes in Shoplytics that support the loading time optimization in Shopware.

Thanks

Florian


No price (and no product ID) on Add to Cart

https://codiverse.freshdesk.com/support/solutions/articles/44002508282--shopware-6-im-event-add-to-cart-auf-der-detailseite-sind-die-%C3%BCbergebenen-daten-unvollst%C3%A4ndig

[Shopify] Error "ERR_NAME_NOT_RESOLVED" in the browser-console

If you are using Shoplytics on Shopify and you see the error "ERR_NAME_NOT_RESOLVED" in the browserconsole with the domain "stream.my-domain.com"...

Thats not a critical error, even if your browser acts like that. You can see that as a warning "Shoplytics is not using first-party-tracking but third-party-tracking is active."

You can either leave it as it is or you can activate first-party-tracking. (removes the error from the browser console and also optimizes data-collection)