-
-
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
Include GeoIP in core after improvements #1823
Comments
Just some input to clarify the terms "country" and "region". Refering to the list of administrative levels used in OpenStreetMaps a country would correspond to admin level 2 while regions would correspond to admin level 4. |
Do we record lat/long for each visitor, or do we assume that other systems will know where to plot a given City I think it is NOT necessary to record lat/long for each visitor. It is sufficient to record the city id. The GeoIP db would resolve each visitors location within the same city to the same lat/long anyway. In fact for each city there is only one lat/long stored in the GeoLite City DB (more precisely in the cityByCountry table). As the number of available cities (= pairs of lat/long) differs between the different GeoIP databases, it makes no sense to put these information into other systems like the world map. |
if I might add to this. The maxmind db gives a city lookup. This does not work how people think it will. |
+1 for this, especially the Apache module detection routine. I get a few fatal errors in my logs because the plugin insists on loading the local files instead of getting the data from Apache. |
I have the commercial db of Maxmind. You can use it if you want for developing the new plugin. Let me know how I can contact you. |
See a bug report in the forum in the php script to update past visits: http://forum.piwik.org/read.php?2,71587,page=2#msg-71784 and fix: http://forum.piwik.org/read.php?2,70989,page=1#msg-92434 |
I'll take this on, in conjunction with the ipv6 ticket. |
|
Great idea. |
In the existing GeoIP plugin, there's a misc/.htaccess file. We don't want this in the new plugin. Access to geoipUpdateRows.php (or equivalent) should be guarded via token_auth. |
Should I delete the .htaccess file in there? |
Yes, you can remove the .htaccess file. After you've run it once, you shouldn't have to run it again. |
$ php geoipUpdateRows.php Fatal error: Call to undefined function _parse_ini_file() in /home/kiplingw/avaneya.com/piwik/core/Config.php on line 373 ??? I also removed the .htaccess file. |
This should be fixed in the updated .zip that I attached to #45. Heres the patch so you don't have to redownload the .zip:
|
Thanks. Applied. How can I test it? |
I ran $ php geoipUpdateRows.php It finished execution (no output), and I noticed the UserCountry_ thing is still there in the stats. Should I just ignore that for now and assume new stats will not have that? |
yes |
Thank you =) |
To answer questions in the ticket:
|
Replying to matt:
I'm thinking of keeping lat/long because:
|
re: comment:13 I would like to propose:
|
great idea! The only thing, is please make sure the few "Provider" special cases are still working. In particular, VisitorGenerator & proxy-piwik.php disable the Provider lookup because it is too slow |
Ok. There are a couple of third party plugins (e.g., KSVisitorImport and TrackerSecondaryDb) that also disable the Provider plugin. |
as a note, these plugins will be obsolete once we implement #134 |
+1 vote for adding regions onto this as well. They are available in GeoLiteCity, so might as well use them. It would be great to include this into a regional map as well that the country map can drill down into. |
Copy of my coment to #5465 (sorry, I used wrong ticket, apparantly, I knew there was one specifically for integration of GeoIP into core): This new plugin sounds promising. But I hope you are going to also keep the old browser language/country detection, maybe named as such. I personally consider that language display equally important as the IP location display. Following scenario: I'm on a travel around the world, and have a travel blog. People accessing that blog are often people I have met on the trip, often still traveling. Now, when I see my Piwik logs, the IP location (which I currently check manually) is surely interesting, but what tells me more about a visitor is actually his browser language. If you check the IP address I am writing this from, you will see that it is Malaysian. How much do I have to do with Malaysia? Nothing. My browser language is German of Germany, which tells more. And the combination of the two IP location and browser country (i.e. the current detection) actually provides one more detail: the visitor is most likely a traveler or an expat. I can imagine website who interested in that marketing information. You would not believe how many travelers roam the world this days. And I would say most of them use the often free WiFi (at their place of stay, bars and restaurants all over Southeast Asia) with their own devices: Laptops, Phones, Tablets, etc. It seems to be the new way of travel, with people sticking their noses into displays half of their time, with most of that time on Facebook. P.S.: Since there are countries with several languages (Belguim, etc.), but also countries with common language (UK, US, etc.), maybe both, the browser country and its language could be shown (if provided by browser). Additionally to the IP location provided by this plugin. |
jawsmith: #638 |
+1 on jawsmith proposal on having a combined vision on location against visitor's preferred language. I imagine an ideal "Vistor countries" GeoIP plugin offering the current "Countries" split, clicking a country name would open a "Regions" list, clicking a region name would open (the currently available) "Cities" list. Then an additional button could be fit at the bottom, between the "Display simple table" and "Display a table with more metrics" that would "Display a table with languages". That table could have one additional column for each language that was detected... |
Replying to vipsoft:
Thank you very much for the info on the browser language detection plugin! That just leaves the browser country detection, in case the GeoIP plugin replaces it in core. (E.g.: Is it a British or an American accessing my website from the Philippines?) |
As the new world map widget will be able to display data for regions and cities, it would be amazing if Piwik would be able to record the data for regions and cities :)
Nope, the world map doesn't store locations for every city. Instead, it will be able to plot any given lat/long onto the map. |
(In [7181]) Refs #1823, fade 'Done' in & out after successfully switched location providers. |
(In [7186]) Refs #1823, many changes including:
|
(In [7187]) Refs #1823, display informative note when Region + City reports have no location data, merge unknown rows in region & city reports and make sure latitude/longitude is rounded in API output. |
(In [7203]) Refs #1823 Adding important-to-have target=_blank |
(In [7204]) Minor text change & provider ordering Refs #1823 |
(In [7205]) remove test Refs #1823 |
This bug is fixed. :) I created a ticket for improvements here: #3442 |
See doc: Geo Locate visitors countries cities and regions. |
(In [7234]) Refs #1823, add note to geoipUpdateRows.php that tells user to re-process their reports. |
(In [7236]) Refs #1823, add note to IP anonymization about geolocation accuracy. |
(In [7260]) Refs #1823, add alternative check for GEOIP_COUNTRY_CODE $_SERVER var to ServerBased GeoIP implementation. |
(In [7281]) Refs #1823, do broken check w/ both GEOIP_ADDR & GEOIP_COUNTRY_CODE. |
(In [7283]) Refs #1823, added redundant trusted hosts warning to general settings page & display help icon that links to faq in warning. |
[7628] refs this ticket, not #1253. (typo in commit msg) |
We need YOUR help! We are running a crowd funding campaign to raise funds to implement the detailed Visitors Maps of Countries, Regions and Cities (for all countries)! These maps will be beautiful, usable, and built using open standards SVG+JS. They will show detailed visitor count, conversion rates, by Country but also (New!) by city and region. Pledge now at: http://crowdfunding.piwik.org/analytics-maps-world-country-city-region/ Piwik needs you! |
See doc: Geo Locate visitors countries cities and regions.
GeoIP plugin #45 is one of the most popular plugins. For a web analytics tool, getting user countries as accurately as possible is critical, and Piwik should help users in this direction.
When the plugin is released in trunk, we should update the FAQ, website pages and wiki pages mentionning GeoIP, and mark as closed the GeoIP ticket #45. For Goals compatibility of GeoIP plugin, see #1434.
Please let us know in the comments your feedback. If you would like to participate... well you know what to do!
The text was updated successfully, but these errors were encountered: