Open dahiro opened 1 year ago
This issue has been mentioned on Matomo forums. There might be relevant details there:
https://forum.matomo.org/t/wrong-content-type-in-multi-event-matomo-call/51381/2
Having the same issue.
Looks like this can be fixed relatively easy.
sendBulkRequest
produces a json, and sendXmlHttpRequest
/ sendPostRequestViaSendBeacon
does not accept a way to set the content type header. So the content type header is wrong for all sendBulkRequet
.
The other way I see, to fix this issue, would be to send application/x-www-form-urlencoded data for sendBulkRequest
.
Sending the correct content-type is indeed something we should do for bulk requests.
hey try this
_paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); _paq.push(['setRequestContentType', 'text/plain; charset=utf-8']);
you have to use 'text/plain; charset=utf-8'
Context
I postet this question already in the forum, but with no feedback so far
We try to use matomo for video/multimedia analytics. Unfortunately not all events are reported to our backend. We found out that there are two types of calls to our tracking backend:
Current Behavior
The issue with 2. ist, that the content-type-header of the request (application/x-www-form-urlencoded) does not correspond to the actual content (application/json or plain/text).
Did anybody else experience this issue and/or has a solution?
Expected Behavior
The POST requests with a request body should have a parsable content-type, like
plain/text
orapplication/json
Possible Solution
We tried to set the following, but with no success: _paq.push([‘setRequestContentType’, ‘plain/text; charset=utf-8’]);
Steps to Reproduce (for Bugs)
I don't know exactly when a multi-event-call (is this even the right term?) is triggered.
Your Environment