-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Track Custom Variables error: Warning - count(): Parameter must be an array or an object that implements Countable #16596
Track Custom Variables error: Warning - count(): Parameter must be an array or an object that implements Countable #16596
Comments
@basos9 thanks for creating this issue. Are you using the Matomo JavaScript tracker? Or how do you track the data? |
Hello, |
And I think I have found a clue.
and this leads to error in tracking Now if we change by removing the quotes and make the lvalue of the hash a list (instead of a string), like this
And url encode and hit, no error is logged and data starts to appear in the database
So i can assume that it might be a javascript client json encoding issue. |
Thanks for this @basos9 . Do you know in what browser this happens and whether that site maybe overwrites |
Hello, |
Thanks for investigating. Be great to let us know what you find out. |
For this webpage we tracked to the inclusion of prototype.js library which was included in our web application. The affected file has a header
The problem is fixed when we removed this library. More specifically this library modified (monkey patches) Builtin in Objects like String and Array, defining among others a Another example using the Chrome's browser console on our site
and on youtube
|
That version was released in 2008 meaning it is older than the first release of Internet Explorer 8. So I guess there is not really much to do as one would need to specifically check for this case which would be weird considering we just dropped support for IE<8. |
See eg #2165 prototype is kind of known actually to have caused issues with JSON and there isn't anything we can do unfortunately. Ideally the project would look at removing this dependency but I understand this is a big ask and not easily done. AFAIK the only other way would be that you overwrite again some of these changes that prototype does. Not sure if we can maybe close this issue but document somewhere this incompatibility or so? |
It seems that this is a library incompatibility issue and the best would be the things mentioned
Thank you for helping sort this out. |
Noticed we haven't actually documented the requirements / supported browsers anywhere for the JS tracker (at least I couldn't find it) so created matomo-org/developer-documentation#392 |
Hello,
It seems that custom variables tracking is not working properly.
The variables are not stored in the databases.
Also with Tracker debug enabled we can see the following error on a tracking request with custom variables
The affected code seems to be
URL decoded url part for tracking request
ENV
The text was updated successfully, but these errors were encountered: