I'd like to generate a Google map that documents (with markers) the location (Brazil, Korea, UK, Australia, etc.) of visitors arriving at a website. Does this capability exist using existing location and gmap modules? Thanks.

Comments

theabacus’s picture

Yes, Gmap and Location module will create a user location map.

bwv’s picture

Thanks.... the user map is generated by users who register. What I am looking for is something that is passive. Perhaps I should have explained in more detail.

Lets say that someone in France is looking for an LP, and they do an internet search, and the search engine (Yahoo, Google, it does not matter) returns a hit from my web site. The person in France clicks on the link and arrives at my site.

He/she does not register, but only visits a page or two.

Is it possible for drupal to read the IP address of the visitor, then translate that IP address into a marker on a google map that would be embedded in my site somewhere?
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207

MidGe48’s picture

It is possible.

This may give you one way of doing so, using the statistic modules. There may be other ways too.

http://drupal.org/node/121189#comment-219453
The node for that comment goes into the issues of coverting IP to some sort of geographical origin.

Doing a search will usually get you the information a lot faster.

www.ZuNOB.com

bwv’s picture

Thanks, that link was useful.
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207

steve02476’s picture

I don't know how to implement this, but it sounds like a great idea. It would be really fun to show a world map with little pins showing either the (presumed) location of visitors from say the last day or week or month or whatever.

WorldFallz’s picture

if one of the IP modules exposes info to views, you could easily make a view display a gmap of marker locations. I'm not too familiar with the IP modules, though there's a few so hopefully one of them stores the info and has views integration.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

bwv’s picture

Thanks WF. The log file here

admin/logs/visitors

Shows the IP addresses of all visitors to the site; the information is, of course, collected passively with no registration required.

I'd like to know if there is a way to translate/re-generate those addresses into data that can be collected in Views, as you suggest above. This can be done, I think, in Views 2 for 6.x, but not in Views for 5.x -- or at least not easily.

----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207

WorldFallz’s picture

I totally forgot about the statistics module-- in d6/views2 you can easily make a view of the all the ips in the log. Then it would just be a matter of theming that view to display a gmap (completely apart from the gmap/location modules) using the gmap api.

For d5 your stuck doing the querying yourself-- since views1 only handles nodes. 8-(

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

michelle’s picture

You might want to have a look at http://feedjit.com/ as well. It's not a Drupal native solution but it's pretty cool and it's free.

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.

bwv’s picture

Since my original post I have found a module which, when combined in some fashion with the location and gmap modules, may, in the hands of someone more capable than myself, serve as the basis for the capability to which I initially referred. (IP addresses are provided by the statistics module.)

http://drupal.org/node/45806 (IP to Country: A simple API for retrieving country information such as country code, country name, flag, network name, and autonomous system number by given IP address. This module is able to use for displaying additional information of IP address instead of just plain IP to help optimize content for readers.)

Here is a link with some sample code from the above:

http://www.howforge.com/how-to-display-information-based-on-geo-location...

I also stumbled upon this source (http://drupal.org/node/19983) for database information, which appears to be updated regularly;

http://geolite.maxmind.com/download/geoip/database/

Thanks.

----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207

michelle’s picture

What timing! I was planning on searching for that very thing soon.

Thanks!

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.

WorldFallz’s picture

I've been trying to help bwv with this for a while-- for some reason I just can't seem to see my way clear to the 'proper' drupal solution. The gmap/location modules already do a user map for registered users by location so I though perhaps it might fit over there. After reading through that code and having a brain embolism I thought maybe not, lol.

Then I though perhaps it should be it's own little module since the data is coming from statistics and really has nothing to do with users or locations anyway. But then I found all these little ip type modules and didn't want to end up on the duplicate module hall of shame list.

If you see any clear way this should be handled, please enlighten, i'm ready to put some time in coding I just don't want to head off in the wrong direction.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

emdalton’s picture

We're currently using maploco.com code embedded in a page node, but I think it doesn't work all that well, and it would be great to be able to take advantage of all the stats we've collected on the site. Does anyone have any further hints on how to integrate these pieces to form a working solution?

twooten’s picture

Hey everybody! I have been working on creating this module for a few days now and have it fairly close to completion. I actually just stumbled upon this post and just wanted to see if there is still interest. It looks like Feb. 6 of this year was the last entry.

Anyway, I've got my module logging all the required info to be plotted on a map. It does not rely on any other module. I have yet to decide how to display the locations mainly because there are so many mapping solutions available. So, the module produces the geographic location of every visitor to your site, how best to display it?

Tim

steve02476’s picture

I think Google Maps would be great.

jinky32’s picture

yeah, agree that google maps would be great!

twooten’s picture

Thanks for the input. I have had the "visitor info" module running on my site for a little over a week now. It's really working nicely. Visitor locations are shown on a google map, city, state, and country are shown in the pop-ups.

I took a screenshot which you can see here.

Hopefully sometime this weekend I can find the time to tie up a few loose ends, make sure everything is well documented and make it available on my site until I can get it contributed to drupal.org.

UPDATE: You can comment here.

DEMO: Visitor Info

Tim

mcfilms’s picture

Really nice work Tim. (that's my way of saying "subscribe"!)

The link to the working demo was not found for me. Maybe it's a permissions issue?

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

twooten’s picture

Thanks Mcfilms,

Try the demo link again, it should be http://wootenswebdesign.com/demo/visitorinfo

Also, let me know if there appears a marker for your city and state. I'm attempting to show only the last x records and need to test that.

Thanks

mcfilms’s picture

Well I'm in LA, so it's hard to tell. Pins were created in Thousand Oaks, South Pasadena and San Diego. I don't know if this is where my current ip resolves to. I am on Verison DSL at the moment. Those first 2 cities are within 12 miles of me.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

twooten’s picture

Cool, seems to be working correctly.

michelle’s picture

Looks nice. Mine didn't show up right away but it's there now that I look again.

Are you going to release this? I'd love to have this on my site.

Thanks,

Michelle

twooten’s picture

I do plan on releasing this module within a few days, just trying to clean up the code first. I just added a "Visitor Info" block to the module that prints a table with city and state. I see La Crosse, Wisconsin, I bet that's you?

Tim

michelle’s picture

That's me. :)

Will be interested in seeing your module when it comes out.

Michelle

twooten’s picture

Ok, take a look at the Visitor Info module. It's my first to be contributed so let me know what you think.

bwv’s picture

The patch at the link below got the module working for me:

http://drupal.org/node/691758