Skip to content

Conversation

@sgiehl
Copy link
Member

@sgiehl sgiehl commented Jan 16, 2026

Description

Sending format_metrics=all should ensure that the metrics are formatted as expected.

There is some strange behavior that a 0 for revenue is sometimes not formatted. The reason for that is, that the original reports misses the revenue column when there were no goal conversions at all for a record.
This is caused by the record builders using https://github.com/matomo-org/matomo/blob/9a3ef94df61682e7d543f3f8b438c368f6eb71a6/core/DataTable/Filter/EnrichRecordWithGoalMetricSums.php, which skips adding revenue if there are no goals converted. This imho doesn't make much sense, but isn't anything we should change here.

replaces #23931

Checklist

  • [NA] I have understood, reviewed, and tested all AI outputs before use
  • [NA] All AI instructions respect security, IP, and privacy rules

Review

@sgiehl sgiehl added this to the 5.7.0 milestone Jan 16, 2026
@sgiehl sgiehl requested a review from a team January 16, 2026 16:17
@sgiehl sgiehl modified the milestones: 5.7.0, 5.8.0 Jan 22, 2026
Copy link
Contributor

@chippison chippison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl
Thanks for looking at this and making time to investigate and point out stuff.

'language' => $language,
'serialize' => 0,
'format' => 'original',
'format_metrics' => 'all',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl
This will format all the metrics that are in micro seconds to be formatted in its default value.
Unfortunately, the scope of the issue is just for the performance based metrics to be formatted in sentence mode.
It should only affect these metrics:

  • avg_time_network
  • avg_time_server
  • avg_time_transfer
  • avg_time_dom_processing
  • avg_time_dom_completion
  • avg_time_on_load
  • avg_page_load_time
    Which are only shown in Performance Overview and Custom Reports where these metrics are added.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes things just fully inconsistent. We really shouldn't start overwriting the formatting just for specific metrics. Maybe the issue just missed those metrics?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that it would be inconsistent if the metrics are formatted differently for just the metrics stated above, but that was what was asked for when 'demo-ing' the feature before

I think the reason to just format the metrics above was because they are usually in actual micro seconds and would be easier to read in 'sentence mode' as compared to 'HH:mm:ss' mode.

It also makes the other duration metrics (not shown above) become 'wider' since most of them would show 'x mins y s' and the formatting does not really make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you making assumptions or does the issue clearly mention that the other duration metrics should not be touched?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was clearly mentioned. I was told that ALL other duration metrics should remain the same, and only those 7 mentioned above should be formatted.

@chip Pison

Only show the NEW format 1.45s for these metrics:

Page Performance

  • avg_time_network
  • avg_time_server
  • avg_time_transfer
  • avg_time_dom_processing
  • avg_time_dom_completion
  • avg_time_on_load
  • avg_page_load_time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see any reason why they should have different formats. Either we want all duration based metrics to be more human readable or not. The pretty format for those metrics used in the UI already is that "new" format.
It is more like a bug, that the formatting isn't applied correctly for scheduled reports.
I'd suggest to iterate back to product team to discuss that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants