xmlhttprequestmatomopiwiktracker

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


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!


Solution

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

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