The integration of Matomo into our Next.js site unfortunately increases the Total Blocking Time (TBT) in http://pagespeed.web.dev (mobile) to 300 to 500ms.
We were thinking of two ideas of how to reduce the impact:
Instead of loading matomo.js as a file, integrate its component directly into Next.js as this may avoid redundant code
Reduce the load for the main thread by utilising a web worker as next/script has now (experimental) support for it
The integration of Matomo into our Next.js site unfortunately increases the Total Blocking Time (TBT) in http://pagespeed.web.dev (mobile) to 300 to 500ms.
We were thinking of two ideas of how to reduce the impact:
Any thoughts on the above?