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 ability to access XHR object in the callback of trackPageView #13665
Conversation
@adityasharma7 be still good to describe your use case to better understand things. And be aware that if image get request is used, the xhr may not be set. |
@tsteur Thanks for your quick response. |
Cheers, so it is mainly the request url you are interested in? The PR looks good and can be merged, it's just to understand the use case so I can check if there's maybe a better way to do it that ensures better backwards compatibility in the future etc. |
Yes, exactly only the request url |
Could we maybe pass |
In Matomo 3.8 we're adding better support for sendBeacon and it can be used by default see https://github.com/matomo-org/matomo/pull/13451/files#diff-1279d666063b65e6d6777f902d11574fR3766 . As there is no XHR object, we need to pass |
Indeed, Though I found another way which I am uncertain of a right solution. There is a method Is it the right way? If no I can use the above method till the changes you suggested are available with the release. if yes, we won't need a change. Looking forward to Matomo 3.8 with https://github.com/matomo-org/matomo/pull/13451/files#diff-1279d666063b65e6d6777f902d11574fR3766 :) Thanks for sharing that. One more thing came to my mind what if we make another tracker and use it to send the request to a non matomo server, is it a valid solution? |
Calling getRequest would work to get all the parameters (it wouldn't include the |
+1. I will see if I can contribute.
Sounds promising. I will update the code soon |
@adityasharma7 I needed the feature now myself so added it here: #13855 Cheers for your PR and the suggestion 👍 and also for letting me better understand why people use the callback 👍 |
@tsteur That's great!!!! |
implements #13662