@beamylake opened this Issue on December 11th 2019

Hello,

we have run into the same problem as mentioned in https://github.com/matomo-org/matomo/issues/7851

When looking at Ecommerce/Overview the average order value graph sticks to zero regardless that the summary and API call report a value other than zero.

ecommerce_evolution
ecommerce_summary

Our Matomo (3.13) setup is still the same as described in https://github.com/matomo-org/matomo/issues/15240

Please let me know, if you need any further information and thanks for your efforts in advance!

@tsteur commented on December 11th 2019 Member

Might be related to #15200 too? @sgiehl ?

@beamylake commented on December 18th 2019

If this question was directed to me - no, we don't experience anything mentioned in #15200

@tsteur commented on December 18th 2019 Member

I can reproduce this... Might have a chance to look at this while working on https://github.com/matomo-org/matomo/issues/11615

@beamylake commented on December 19th 2019

Looks like this yet might be related to https://github.com/matomo-org/matomo/issues/15200

When using English all numbers are correct (the number and formatting of the number) - but when using German as language setting, the numbers in the visitor overview are misformatted and partly wrong rounded.

But this partly also applies to the Ecommerce overview: For example, in English the conversion rate is shown with 0,5% (which is correct) and in German it is shown with 0%

@beamylake commented on January 20th 2020

FYI: The release of 3.13.1 fixed issue https://github.com/matomo-org/matomo/issues/15200
Unfortunately this problem still exists.

@sgiehl commented on November 19th 2020 Member

@tsteur The problem for that is again related to the number formatting. The evolution chart fetches the report formatted, so the values for order value are somewhat like $123.45. But when generating the data for the graph the numbers are casted to float here:
https://github.com/matomo-org/matomo/blob/115527353a9e75e01aa4d263408956ae45403bea/plugins/CoreVisualizations/JqplotDataGenerator/Chart.php#L69-L71
This results in 0 values for strings not starting with a number.
This might not be as easy to fix as I thought. First tried to simply fetch the report without formatted numbers. That actually fixes the problem for the order value. But that creates a problem with any rates displayed. e.g. a conversion rate would than show 0.04 instead of 4, as the number is not formatted anymore. Tried format_metrics = bc, but that doesn't do the trick either...

@tsteur commented on November 20th 2020 Member

@sgiehl I suppose we can't simply replace $€ etc with an empty string there? Would this help (of course not best solution but if it mixes most issues might be a solution.) or in case we know it is supposed to be a number we could keep only numbers and dots and remove everything else? But I suppose a number may look like $123,45 when German is selected and it all doesn't work?

@sgiehl commented on November 20th 2020 Member

The german format would actually be catched by forceDotAsSeparatorForDecimalPoint, as it would replace the , with .. On the other side might that replacement break bigger numbers like 2.000,44 or even other language formats that use their own chars as floating point or thousands separator. In addition there is not only the German format and not only $ and . Every currency might have it's own translation for each language.
And that actually does not only happen for currency values. If you switch the language to Euskara the same problem appears for the conversion rate. Euskara uses % #,#<a href='/0'>#0</a> for formatting percentage, so it has the same problem.

Imho it would be correct to fetch the numbers unformatted for building any chart. Guess the only problem would be the percentage metrics, that would actually be calculated while formatting...
Maybe we need to think about changing all those metrics, so they do not do a calculation while formatting?

@tsteur commented on November 22nd 2020 Member

Maybe we need to think about changing all those metrics, so they do not do a calculation while formatting?

That would be great 👍

@Starker3 commented on May 17th 2022 Contributor

We have another user experiencing this issue.

@atom-box commented on May 25th 2022

A user reports:

"We are not getting the actual average value graph for the customer,
The average value according to the site is $1435 but the graph shows a flat zero every month."

This Issue was closed on June 15th 2022
Powered by GitHub Issue Mirror