Weird results in orders output

Hi

Has anyone else experienced errors on results appearing in the reported orders, in Ecommerce? I’ve used the option to use the GA4 tag to send the order information to Piwik. Most times the order comes out exactly as expected and items like the order ID are always correct. It’s the Sum of Revenue that is all over the place, sometimes it’s reported correctly sometimes it just completely wrong. It’s never missing a figure but often the figure is wrong.

When I populate the GA json, I’m using the figures from the database order record so I have a clear picture of what the figure should be.

Has anyone else come across this? Any thoughts on what I might have done wrong?

Thanks
Paul.

Hi,
Make sure that you are using correct values in your ecommerce tag as well as parse the correct information from your dataLayer variable as this seems to be the most probable root of the problem here. Maybe, there are objects within different or the same dataLayer events that have the same name and this makes the values erroneous?

What I would suggest doing is to go through the whole setup once again while following the ecommerce documentation as this is the best way to optimize your ecommerce setup.

Thanks for the response.

What’s odd here is that most times it works as expected and since the logic that sets up the tracking is consistent, the question is why is it sometime logging incorrect numbers.

I’m planning to add some internal logging to our database so, I’ll log all the details in our database at the point the code builds the tracking json for GA, and compare the data that is then shown in Piwik vs the logged data.

While that’s running I’ll take your advice and redo the setup. It can’t hurt as it was one of the first things I did when we were trialling Piwik and maybe I got something wrong.

Thanks for the assist.

Sure, let me know if it works for you.

Hi

Ok, I’m fairly sure now that Piwik is not recording transactions correctly. I’ve been logging the transaction data locally each time I add the data to the data layer. The end result is 585 transactions logged on my side for the 13/2, when I look at the ecommerce section of Piwik only 567 transactions have been recorded. I’ve compared the order id’s and can see the missing items recorded in my system but missing from Piwik reporting. Since the logic is identical for every transaction it can’t be a case of using incorrect values in the ecommerce tag. If I’d made a coding error then the 567 transactions that are being recorded shouldn’t be there.

Am I really the only user that is seeing this behaviour?

There are 2 most usual issues with ecommerce tracking consistency:

  1. Order ID deduplication - our tracker deduplicates same order IDs within a single session. Doesn’t seem to be the case here but worth mentioning anyways.

  2. Broken events that are a result of incorrect values sent to the dataLayer (and therefore to the ecommerce tags). It would be best if you could give us example of products that are included in the missing orders and a way to test this. You can also test this yourself by replicating the missing order and checking the dataLayer object (both order and product info) and the tracker debugger for broken events (preferably after setting the lookback window to 6 hours).

As a side note - not sure what’s your method of recording the transaction count but if you are comparing Piwik PRO to the store’s database then some discrepancies will for sure be visible. That’s because you can’t really block the process of storing the transaction in your database but you can for sure block Piwik PRO from tracking it. If you want to achieve 100% coverage then HTTP API/server side would probably be the way to go.

It’s almost certainly not the first issue, as this is about missing order id’s not duplicates.

As for the second that can’t be applicable either. When looking at the 13/2/2024, 567 transactions are showing in Piwik Pro, with 18 missing. The code logic is the same for all transactions, there is no scenario where the data would follow a different format or logic path for the missing transactions.

I’ve been trying to investigate the discrepancies I’m seeing between what’s in our system vs GA4 vs Piwik Pro. I added an additional step in my code to log to a db table the details that were being added to the data layer, giving me a one to one comparison and enabling me to confirm the orders that should be appearing in Piwik. I’ve confirmed that the missing orders are valid external customer orders and should be in Piwik, the problem I have now is I have no idea why Piwik is missing the transactions.

Do you have any additional information on what would cause the blocking of Piwik Pro tracking on the customer (user) side?

You’d be surprised what kind of bugs I’ve seen related to this case :sweat_smile:.

In case you see more coverage in GA4 than in Piwik PRO then it could also point to the case 2 (incorrect data types) as GA4 (and I believe that the same was for GA3) seems to accept more data types even though the official documentation suggests otherwise.

As I have mentioned before, it would be best to share the dataLayer event/object of the missing orders to give us a clue on what could’ve gone wrong. It would probably best to simply recreate the order with same products and cancel it later. You can share the details in a private message, doesn’t have to be shared here.

AdBlockers/Tracker blockers are one thing but not entering the page where the dataLayer event should be triggered is another thing that could happen. This can usually be checked in session log.