matomo-tracker-react-native icon indicating copy to clipboard operation
matomo-tracker-react-native copied to clipboard

Page performance

Open uzun0ff opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. There isn't a good way to report page performance data.

Describe alternatives you've considered Sending custom data like an optional parameter works, but it feels like you're not supposed to extract response times manually.

Additional context Screenshot 2022-12-13 at 11 48 03

uzun0ff avatar Dec 13 '22 09:12 uzun0ff

Ok let me understand this.

I found some documentation about page performances here: https://matomo.org/faq/how-to/how-do-i-see-page-performance-reports

In the API there is a section called "optional page performance info" here: https://developer.matomo.org/api-reference/tracking-api#optional-page-performancehttpsmatomoorgfaqhow-tohow-do-i-see-page-performance-reports-info

This means, it should be possible by gaining several values and post them to Matomo, right? So the main question is, how to obtain these values!? I don't know about it. Maybe there are browser APIs that are accessible for these cases?

donni106 avatar Dec 13 '22 10:12 donni106

@uzun0ff where you able to resolved this?

angelxmoreno avatar Nov 12 '23 20:11 angelxmoreno

@uzun0ff where you able to resolved this?

Unfortunately, I had no success 😕

uzun0ff avatar Nov 14 '23 07:11 uzun0ff

@uzun0ff @donni106 I think the first issue here is how to gather performance metrics from react native.

I know of a few tools, Flipper being one of them, but that only works locally.

angelxmoreno avatar Nov 14 '23 08:11 angelxmoreno

First let's talk about how to translate the page performance metrics of Matomo to native apps theoretically, right?!

For pageviews the following page performance metrics can be tracked:

pf_net — Network time. How long it took to connect to server.
pf_srv — Server time. How long it took the server to generate page.
pf_tfr — Transfer time. How long it takes the browser to download the response from the server
pf_dm1 — Dom processing time. How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it.
pf_dm2 — Dom completion time. How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event.
pf_onl — Onload time. How long it takes the browser to execute Javascript code waiting for the window.load event.

All page performance metrics expect a value in milliseconds.

For screens in native apps we have either a subset of these metrics or different meanings.

donni106 avatar Nov 15 '23 15:11 donni106