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

Add JS tracker methods setPagePerformanceTiming and getCustomPagePerformanceTiming to set specific values for performance metrics #16859

Closed
tsteur opened this issue Dec 2, 2020 · 0 comments · Fixed by #17901
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Dec 2, 2020

Similar to how we used to have setGenerationTimeMs.

We then need to document this in https://developer.matomo.org/guides/spa-tracking similar to how the other method used to be documented. Also of course need to document the JS Tracker reference etc.

We'll also need to adjust in JS tracker the logged console message in the setGenerationTimeMs method and mention to use this new method instead or maybe we can even somehow map setGenerationTimeMs to the new method but likely this wouldn't make any sense. Same in developer changelog need to adjust the text where we mention the setGenerationTimeMs removal.

@sgiehl feel free to close if we already have an issue for it. Couldn't find it.

It's to be seen how this makes sense because some performance metrics might not really make sense in SPA etc. Eg whether we have only one method and by default all metrics will be reset except the ones specified or whether we have individual metrics (but then the problem be that other performance values aren't reset and reports would become wrong).

We need a new JS tracker API method to set these Performance Tracking HTTP API parameters. A name could be for example setPagePerformanceTiming(networkTimeInMs, serverTimeInMs, ...) and then the related tracking API parameters should be appended in the next tracking request. Basically users should be able to call eg _paq.push(['setPagePerformanceTiming', 35, 103, ...]). As far as I know all the parameters should be optional and if no value is set, then we won't send the related tracking parameter.

When someone sets the custom page performing timings, then we don't detect the timing ourselves.

The new method needs to be documented in https://developer.matomo.org/api-reference/tracking-javascript

Any set value will be sent along the next tracking request and then the configured values are reset so that the same values aren't sent in any following tracking request after that.

@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Dec 2, 2020
@tsteur tsteur added this to the 4.3.0 milestone Dec 2, 2020
@tsteur tsteur changed the title Add JS tracker methods for performance metrics Add JS tracker methods to set specific values for performance metrics Dec 2, 2020
@tsteur tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Jul 27, 2021
geekdenz pushed a commit that referenced this issue Aug 18, 2021
@geekdenz geekdenz modified the milestones: 4.7.0, 4.5.0 Aug 20, 2021
geekdenz pushed a commit that referenced this issue Aug 23, 2021
geekdenz pushed a commit that referenced this issue Aug 23, 2021
geekdenz pushed a commit that referenced this issue Aug 23, 2021
geekdenz pushed a commit that referenced this issue Aug 23, 2021
geekdenz pushed a commit that referenced this issue Aug 24, 2021
geekdenz pushed a commit that referenced this issue Aug 24, 2021
geekdenz pushed a commit that referenced this issue Aug 25, 2021
to work as expected added comments from @sgiehl
because this is not obvious
geekdenz added a commit that referenced this issue Aug 30, 2021
geekdenz added a commit that referenced this issue Aug 30, 2021
geekdenz added a commit that referenced this issue Aug 30, 2021
correct unit tests
improve queryStringify()
geekdenz added a commit that referenced this issue Aug 31, 2021
geekdenz added a commit that referenced this issue Aug 31, 2021
geekdenz pushed a commit that referenced this issue Sep 4, 2021
geekdenz pushed a commit that referenced this issue Sep 4, 2021
geekdenz pushed a commit that referenced this issue Sep 4, 2021
geekdenz pushed a commit that referenced this issue Sep 4, 2021
Co-authored-by: Stefan Giehl <stefan@matomo.org>
geekdenz pushed a commit that referenced this issue Sep 7, 2021
geekdenz pushed a commit that referenced this issue Sep 7, 2021
geekdenz pushed a commit that referenced this issue Sep 7, 2021
geekdenz added a commit that referenced this issue Sep 9, 2021
geekdenz pushed a commit that referenced this issue Sep 12, 2021
we could write more functions like this in
the future, e.g. mapIn, filter or map, but
currently this is not needed because there
is just this one use-case
@justinvelluppillai justinvelluppillai changed the title Add JS tracker methods to set specific values for performance metrics Add JS tracker methods setPagePerformanceTiming and getCustomPagePerformanceTiming to set specific values for performance metrics Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants