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

Maps, See where your visitors are coming from, Maps shows them to you drawn on a Map #1258

Closed
anonymous-matomo-user opened this issue Mar 30, 2010 · 23 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@anonymous-matomo-user
Copy link

Features of this version:
This version provides a widget that represents Live users on a Map and in the visitor menu you can find the same Map.

Howto Install:
Download the zip provided as attachment
unzip, it will create a directory Maps
copy this directory in piwik/plugins/
in config add the following section

[Maps]
maps_key = "Here your Google Maps API key"

go to Piwik > Settings > Plugins and enable the plugin

Changelog:
0.1: Beta release first features are implemented and ready to be tested. Note this version can contain bugs.

Upcoming:
Show visitor data retrieved from archive
Show visit intensity
Switch between Continent, Country, City view by buttons instead of only by zoom.

In a later stage other Maps providers will be add.

@mattab
Copy link
Member

mattab commented Mar 30, 2010

That sounds interesting! could you please post screenshots of all the new screens added? thx

@anonymous-matomo-user
Copy link
Author

Attachment:
menu_continent.PNG

@anonymous-matomo-user
Copy link
Author

Attachment:
widget_continent.PNG

@anonymous-matomo-user
Copy link
Author

Attachment:
widget_country.PNG

@anonymous-matomo-user
Copy link
Author

See that there is a problem with the city view will fix asap.

@anonymous-matomo-user
Copy link
Author

Attachment: Fix: City view
Maps_0.1.zip

@anonymous-matomo-user
Copy link
Author

Attachment:
menu_city.PNG

@mattab
Copy link
Member

mattab commented Mar 30, 2010

Good start, I would like to see this included in Piwik core at some point. But there would be a few things to change. Would you be interested into having this in core?

I have a few questions

  • Does each dot represent a visitor?
  • if it is a google map, could we use the google maps markers and have a popup for each visitor that would contain all the Live! plugin info currently displayed in the Live! widget? ie. OS, browser, page viewed, visit time, etc.
  • how often does the map get updated?
  • if GeoIP is installed, does it use the lat/long info?
  • if GeoIP is not installed, does it still work? where from do you get the lat/long info for countries?

I gathered some thoughts in the ticket #274 ; generally I think our safest approach would be to use the open source technology SVG to draw maps, instead of relying on google maps (if we want to include this in core). Let me know what you think!

@anonymous-matomo-user
Copy link
Author

Offcourse I am interested in putting it in the core. I will try to answer your questions.

At the moment every dot represents a continent, country or city. I have done this to prevent drawing endless pointers on the same place. lat/long data is on city level so drawing multiple dots would be useless. In the future coloring will indicate visit detail.

In a later stage I will add a click event to a marker to get the necessary details. At the moment Live! doesn't provide lat/long data. So I wrote my own API at the moment this can be replaced in the future.

The data is updated every 30sec. Will be adjustable in the future.

At the moment GeoIP needs to be installed because my API is gathering data like lat/long.

I created 2 DataFiles for lat/long info for countries and continents these are build from the MaxMind files. I am not sure if the abbreviations of GeoIP are similar of those piwik is using? If so these datafiles could be used also when GeoIP is disabled.

I did some research in the different maps provider and in general Google or Yahoo provide a more detailed map at the moment the opensource maps just miss general information like city names in most parts of the world. For me this was the decision to choose for Google.

I used the flash SDK which gives the advantage that all the methods needed to draw the map are build within the SWF the only thing that is retrieved from Google are the tiles. And I think that it is saver to rely on Google for the tiles then a opensource alternative.

I understand that this decision is controversial but in the end I think it is saver for now to bet on a Google or Yahoo. To be clear in the future I also will support openstreetmap but this hasn't priority at the moment. I hope this won't generate any problems.

@mattab
Copy link
Member

mattab commented Mar 30, 2010

I wasn't suggesting openstreemaps, but instead using SVG maps and add pointers/markers dynamically onto them. Take a look at #274 for pointers to SVG maps (on wikipedia).

The big problem with google maps is the need for the API_KEY. We can't force Piwik users to get one, so we would need to be independent from third party providers (and SVG is becoming really strong as a technology).

Having this plugin as a 3rd party is fine too, for sure. If you want to have it included in core, we would need to consider being independent from google or yahoo (or even openstreetmaps). Let me know what you think!

@anonymous-matomo-user
Copy link
Author

I think that it is really interesting the SVG maps but at the moment it is rendering very slow. Here it took a minute to render a world map. Will do some extra research on this to see if I can make it work for the Maps plugin.

I can also try to port it to the Google Javascript API 3 from Google this doesn't need a API key anymore. But then you still are depended on Google.

@anonymous-matomo-user
Copy link
Author

I think I can also make it work in SVG now found a map that has some nice features that I can use now i need to find a way how I can make the zoom element. Will drop Google for now and focus on SVG.

Is also interesting for me because I am going to learn a lot more with SVG then with Google Maps that did all the thinking for me.

@mattab
Copy link
Member

mattab commented Mar 31, 2010

renelux, great to hear.
I personally don't know much about it, so anything you find or build is going to be useful.

Please feel free to post all your SVG related findings in the other ticket #274 with maybe a proposal (text or code) of how you think we should implement it in Piwik, and we can discuss / review. Cheers

@anonymous-matomo-user
Copy link
Author

Hello, thanks for the great plugin!
When I click on MapsLive! the map is only 205px heigh.. I tried changing the file controller.php to:

function getLiveVisitorsMapMenu() {
        $this->view("Maps.getLiveVisitsWithGeoDataDetails", "100%");
    }

But it's the same..

@anonymous-matomo-user
Copy link
Author

Hey, why not using google charts to display the visit numbers? http://code.google.com/apis/charttools/
Just a suggestion!

@anonymous-matomo-user
Copy link
Author

I'm getting an error trying this plugin.

Error Loading GeoData
faultCode: Client.CouldNotDecode
faultString: 'Error #1085' faultDefault: 'null'

What does it mean?

Google API key is in the config file...

@mattab
Copy link
Member

mattab commented May 12, 2010

Renelux, any update on the map plugin using SVG?
Thanks

@anonymous-matomo-user
Copy link
Author

Matthieu, I did look in to it but at the moment I am lacking time to work on the plugin. It is possible to let it work with SVG but in browsers like IE it is slow and not very usable.

Will see if I can contact Gregor who posted in the forum topic, about his Map in flash if we can use that I think that will be a better solution.[]

@anonymous-matomo-user
Copy link
Author

Replying to cschneider:

I'm getting an error trying this plugin.

Error Loading GeoData
faultCode: Client.CouldNotDecode
faultString: 'Error #1085' faultDefault: 'null'

What does it mean?

Google API key is in the config file...

I'm having the same problem. Could someone explain?

Thank you!!!

@anonymous-matomo-user
Copy link
Author

After the last piwik-update -> 0.6.4. I get some errors: #1505

@gka
Copy link
Contributor

gka commented Jul 25, 2010

I just created another maps plugin for piwik, which doesn't rely on external services like google maps.

[1514]

@anonymous-matomo-user
Copy link
Author

Some errors can be fixed:

Maps/Maps.php, line 50:
Piwik_EditMenuUrl('General_Visitors', 'Maps Live!', array('module' => 'Maps', 'action' => 'getLiveVisitorsMapMenu'));
to:
Piwik_AddMenu('General_Visitors', 'Maps Live!', array('module' => 'Maps', 'action' => 'getLiveVisitorsMapMenu'));

Maps/API.php, line 104:
/*$sql = "SELECT *, COUNT(".$count.") AS total
FROM " . Piwik::prefixTable('log_visit') . "
$sqlWhere
GROUP BY ".$count."
ORDER BY visit_last_action_time DESC
LIMIT $limit";
*/
to:
$sql = "SELECT *, COUNT(".$count.") AS total
FROM " . Piwik_Common::prefixTable('log_visit') . "
$sqlWhere
GROUP BY ".$count."
ORDER BY visit_last_action_time DESC
LIMIT $limit";

But still I get no ne markers on the google map, google maps api key and auth-token are not always submitted correctly (problem shall be reproducable with the posted changes). Does anyone knows this problem and can provide a workaround?

@mattab
Copy link
Member

mattab commented Nov 16, 2010

Renelux, do you plan to maintain the plugin? please let us know and we will reopen the ticket.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants