-
Notifications
You must be signed in to change notification settings - Fork 83
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
disableSendImageResponse() does not work properly #86
Comments
@NicoHood this works for me nicely. It sets the correct parameter You can track the resolution using the |
I also tried it again and it works now. I am not sure what I did wrong, I assume it was my mistake. Really strange. Sorry for the confusion. However the response code is always 400 (bad request) and in the dashboard I cannot see any page view. $matomoTracker = new MatomoTracker((int)$site_id, $matomo_url);
$matomoTracker->setTokenAuth($token);
dump($matomoTracker->getUrlTrackPageView($page->title()));
// -> I then manually enter the url in the browser |
You can try enabling the debug mode of the Tracker in Matomo by adding this to your config.ini.php [Tracker]
debug = 1 When you then open a tracking url in the browser you should see some debugging output. Maybe that helps to identify the problem. |
Nice, the error is: Now I've set up a proper token, however the url returned by By "working" I mean the correct response code is returned. The gif was sent anyways, even with a 400 response (I am not sure if that is intended) Now I am am bit lost on how to fix that properly. This issue is related: |
It turns out to be like that: The reason why it does not work is, because I am setting an auth token. Because the auth token is specified the The workaround would be to:
But why is the token omitted for Possible solutions:
You should know best what to do. |
Depending on the rights of the user the token belongs to, someone could do anything with your Matomo instance using the token, as it's also usable for authenticating any API request. |
I also want to not that |
You can likely get the |
The URL should always include a parameter |
https://developer.matomo.org/api-reference/PHP-Matomo-Tracker#disablesendimageresponse
I am using the following code:
When I open the url at $ret I always see a gif image instead of a 204 response.
Also, is there an option to tell matomo if the url got requested, the user uses a screen resolution of AxB? Combined with some clever css we could track the resolution of user devices:
https://medium.com/javascript-in-plain-english/tracking-with-css-ec98e3d81046
https://www.templarbit.com/blog/2018/03/20/tracking-users-with-css/
The text was updated successfully, but these errors were encountered: