Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix average order value graph flattening out to value 0 #15262

Closed
beamylake opened this issue Dec 11, 2019 · 11 comments · Fixed by #19353
Closed

Fix average order value graph flattening out to value 0 #15262

beamylake opened this issue Dec 11, 2019 · 11 comments · Fixed by #19353
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@beamylake
Copy link

Hello,

we have run into the same problem as mentioned in #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 #15240

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

@tsteur
Copy link
Member

tsteur commented Dec 11, 2019

Might be related to #15200 too? @sgiehl ?

@beamylake
Copy link
Author

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

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 18, 2019
@tsteur tsteur added this to the 4.1.0 milestone Dec 18, 2019
@tsteur
Copy link
Member

tsteur commented Dec 18, 2019

I can reproduce this... Might have a chance to look at this while working on #11615

@beamylake
Copy link
Author

Looks like this yet might be related to #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
Copy link
Author

FYI: The release of 3.13.1 fixed issue #15200
Unfortunately this problem still exists.

@sgiehl
Copy link
Member

sgiehl commented Nov 19, 2020

@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:

array_walk($data, function (&$v) {
$v = (float) Common::forceDotAsSeparatorForDecimalPoint($v);
});

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
Copy link
Member

tsteur commented Nov 20, 2020

@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
Copy link
Member

sgiehl commented Nov 20, 2020

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 % #,##0 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
Copy link
Member

tsteur commented Nov 22, 2020

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

That would be great 👍

@mattab mattab modified the milestones: 4.1.0, 4.2.0 Dec 21, 2020
@mattab mattab modified the milestones: 4.2.0, 4.3.0 Feb 22, 2021
@mattab mattab modified the milestones: 4.3.0, 4.4.0 May 26, 2021
@tsteur tsteur modified the milestones: 4.4.0, 4.7.0 Jul 22, 2021
@tsteur tsteur modified the milestones: 4.8.0, 4.9.0 Feb 9, 2022
@tsteur tsteur modified the milestones: 4.9.0, 4.10.0 Mar 2, 2022
@justinvelluppillai justinvelluppillai added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Apr 12, 2022
@Starker3
Copy link
Contributor

We have another user experiencing this issue.

@atom-box
Copy link

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."

@bx80 bx80 self-assigned this Jun 9, 2022
@justinvelluppillai justinvelluppillai changed the title Average order value graph flattens out to value 0 Fix average order value graph flattening out to value 0 Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants