Skip to content
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

Default GeoLocation via language is not working. #7632

Closed
d4rken opened this issue Apr 6, 2015 · 3 comments
Closed

Default GeoLocation via language is not working. #7632

d4rken opened this issue Apr 6, 2015 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@d4rken
Copy link
Member

d4rken commented Apr 6, 2015

I'm using the Android-SDK to send queries to Piwik.

I can see that query from Android contains the correct paramters:

country=US&lang=en

The language is also displayed in the Piwik "Location" tab, but it still says I'm located in Germany, which I am, but it should place me in the USA?

I'm using Piwik 2.12.1

Another test:

country=NL&lang=nl

Still places me in Germany instead of the Netherlands.

@mattab
Copy link
Member

mattab commented Apr 7, 2015

Hi @d4rken

Thanks for the report. Setting country=us does not currently work for you because this API parameter requires you to set token_auth (see doc)

To solve this issue, maybe we could simply make country/region/lat/long/city API parameter not require anymore token_auth to be set. This would make sense as part of our previous work in #6109 #6407 and #6110

@d4rken
Copy link
Member Author

d4rken commented Apr 7, 2015

@mattab Could you please change the documentation?
edit: Or point me where i could change it, if below assumption are correct.

The default location provider guesses a visitor's country based on the language they use. This is not very accurate, so we recommend installing and using GeoIP.

http://developer.piwik.org/api-reference/tracking-api
Other parameters (require authentication via token_auth)
An override value for the country. Should be set to the two letter country code of the visitor (lowercase), eg fr, de, us.

^ No mention of GeoLocation

An override value for the Accept-Language HTTP header field. This value is used to detect the visitor's country if GeoIP is not enabled.

^ Language doesn't state to require a token.

Nowhere does it state that the country parameter is used to determine the location (although somewhat expectable), it says everywhere it's based on the language and that doesn't require an api token. API DOCs & Piwik GeoLocation settings say that.

Regarding your suggestion:
My first thought was that this makes it open for abuse. People could set random values.
But is this really an issue, let's say people are abusing it and the dev notices, when then GeoLocation is changed to a different type, is that then overriding the country parameter in the Piwik console?

@mattab
Copy link
Member

mattab commented Apr 8, 2015

Alright I re-read better and of course there is a bug, that the lang parameter doesn't seem to be used by the fallback location provider. we will investigate this

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 8, 2015
@mattab mattab added this to the Piwik 2.14.0 milestone Apr 8, 2015
@diosmosis diosmosis self-assigned this Apr 20, 2015
diosmosis pushed a commit that referenced this issue Apr 20, 2015
…guage using request object not visitor object, since the Country dimension will be triggered before the Lanuage one. Includes test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants