Access XHR object in callback of trackPageView() using Piwik.js (matomo)

131 Views Asked by At

I am using Matomo for tracking page view. I have a requirement where on completion of XHR request of track page view I need to perform some operation which involves accessing xhr (XmlHttpRequest) object. I figured out that with trackPageView() described here we can pass customTitle, customData, callback. I was able to pass a callback function as a parameter but I am not able to access xhr in the callback.
Is there some way I can access xhr in the callback function?

Thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

I think this is now solved thanks to a recent pull request:

https://github.com/matomo-org/matomo/pull/13665