setGenerationTimeMs is not working after upgrade to 4.x

Hi @thomas_matomo,
After upgrade 4.X ‘setGenerationTimeMs’ is not working and below is the error message showing “setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. There is currently no replacement yet”,
Do we any alternate for this, please guide us how to solve this.

Thanks
Sampath

Hi,

Matomo 4 replaces the old page load time, with the detailed performance metrics that record a lot more numbers.
This means that setGenerationTimeMs doesn’t exist anymore:

What exactly are you trying to achieve that isn’t working out of the box with the recorded statistics from the performanceAPI?

There is not yet a way to set these values manually, but if you are interested, a PR for this would be helpful:

@Lukas / @thomas_matomo - we are currently using this method for setting up the time taken for a SPA page load (route change success).

If this is deprecated, how do you want us to proceed further on this?

Thanks a lot.

I guess in that case it is best to contribute to https://github.com/matomo-org/matomo/issues/16859. It should not be too hard to add a function that overrides the automatically detected values.