-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Fix Matomo country logging by sending country code instead of country #2392
Conversation
… name Matomo expects the country code in lowercase for accurate logging and proper flag display
EDIT: Ugh, sorry, I just realized it was a couple lines later 😅. I should have just continued reading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. Thanks for linking to the docs where it is explained what's the expected value.
You'll probably have to apply a coding style fix (global functions need to be explicitly imported, so you'll have to add use function strtolower
).
Additionally, the MatomoVisitSenderTest
will probably need to be fixed. If it isn't because this case was not covered, then it would be good to add the missing test.
I've applied the style fix. I have little experience with coding and none with tests. I looked at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2392 +/- ##
==========================================
Coverage 93.87% 93.87%
Complexity 1707 1707
==========================================
Files 277 277
Lines 5915 5915
==========================================
Hits 5553 5553
Misses 362 362 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ugh, that's unfortunate. Pinning to a fixed version is fine for now, as that's an unrelated issue. I'll try to address the actual problem afterwards.
That's fine, I can add the missing test. You helped a lot already.
In the dev environment, the GeoLocation is probably not working because it will be using the docker network IP address, not your public IP address. The fact that it doesn't error out is probably good. I'll try to hardcode an actual public IP address later and see if matomo likes the result. |
It works 🙂. There's the Spain flag when using a public IP address from Spain. |
The |
Thanks for your guidance and patience :) |
Sending the country code is not enough, to display the country flag Matomo expects the code in lowercase. With only the code the flag in Matomo is still the question mark.
I hope it's okay to manipulate the capitalization at this location.
This fixes #2391
From the Tracking API documentation: