General Google Analytics and Google Earth
Posted in General
June 12th, 2006 —3:44 pm

I mentioned before that I have a Google Analytics account. One of my cow orkers asked if they had a way to export information into Google Maps or Google Earth, and I said I don’t think so, it’s still in beta. But they do have a way to export information, so I hacked together a quick program to translate Google Analytics geo information to Google Earth’s KML format.

In Google Analytics, open Marketing Optimization, then Visitor Segment Performance. Click on Geo Map Overlay and you get their best world-map overlay. If you look at the upper right of the data window, you see an Export section, and the first icon is a T. Click it and save the data somewhere. That’s what I use to get the information for my site.

Compile analytics2kml.cpp (or Seiz’s modified version), or download my statically linked Linux binary here. See a copy of a converted file here.

Feel free to use my online version of the converter here.

See a screenshot of some results from this site here.

Like this utility? Browse my blog for more interesting things.

2006 November 27 Update:


Seiz’s Version

Stefan Seiz sent a modified version of this short program back to produce slightly different visual results. Now you have two choices! Get his source code here.

I’ve updated the online utility to give everyone a choice for which version they’d like to use, regular or plus-Seiz. Heh heh. Man I crack myself up sometimes.

Update 2007 May 14
Apparently Google has taken it upon themselves to make a new interface, and I’ll be working out how to use the new interface with the analytics2kml converter soon. In the meantime, switch to the older interface (right after you log in) and use the old export function.

July 26 2007 Update
Well, Google has officially stopped providing the data this entire project was based on. Until they allow exporting of GEO data again, or provide their own KML output, we’ll just have to live with their decision. In the meantime, please write to Google and suggest KML output or to re-allow exporting of GEO data. Thanks for your support!


60 Responses to “Google Analytics and Google Earth”


Gravatar Quoth Jacob’s Blog » Converting Google Analytics to Google Earth

[...] I wrote a program to convert Google Analytics data over to Google Earth's KML format, you can even convert online. Head over to my Convert Google Analytics to Google Earth KML page and give it a try!   [...]


Gravatar Quoth Adam S.

Works great! Lots of fun to use and a handy way to visualize a long list of numbers.


Gravatar Quoth Gerald Buckley

Hey, thanks for the tip over at the g-WH!Z blog. Appreciate that. I’ll be using your converter here in just bit to try it out. Thanks for thinking of doing this!


Gravatar Quoth Stefan

Works like a dream and a great idea. Thanks.


Gravatar Quoth jcburns

Well done! And yeah, Google Analytics should have a ‘kml’ button that makes all your hard work unnecessary.


Gravatar Quoth Matt

Great script! Works like a charm.
Thanks!


Gravatar Quoth Gareth

Excellent. What a great idea. I’m sure Google Analystics will push to include this in a future version. Works great. FWIW, I’ve posted my KML file on my Another Chance To See website for people to see.


Gravatar Quoth James Fee

Way cool man!


Gravatar Quoth James Fee - GIS & ESRI Blog :: Checking out the Google Analytics to KML converstion tool

[...] I have to admit, this really opens your eyes when you see how global everything is these day. If you have a Google Analytics account, visit Scurvy Jake’s Pirate Blog and run the code. [...]


Gravatar Quoth B-Star

That is so cool! Nice work! Thankx for sharing!


Gravatar Quoth 蚂蚁的天空 » Yesterday Readings

[...] Google Analytics and Google Earth # [...]


Gravatar Quoth Webmaster

Heard about this on Ogle Earth blog and had to wait until my Google Analytics account got activated to try it out. It was worth the wait. Thanks for your hard work.


Gravatar Quoth Simão

Just excellent!
Thanks again and again.
It is nice to see where visitors are coming from!
“It’s a small world after all!” ;)
Say something when u come in Paris!


Gravatar Quoth Ian Davies

Wow! That’s fantastic - thanks so much for creating this program!


Gravatar Quoth A delicious learning experience… » Blog Archive » links for 2006-06-27

[...] Google Analytics Viewers via Google Earth a converter to take the data collected by Google Analytics for where users are visiting your site and display the data as placemarks in Google Earth (tags: Google_Earth) [...]


Gravatar Quoth Reggie

Thanks for all of your work. It’s a great tool to have.


Gravatar Quoth Bull_UK

Great tool, the kml produced even opens in NASA World Wind, my personal preference as I’m an OS dev on the project.


Gravatar Quoth Webmonster

Thanks, I’m glad it works elsewhere as well.


Gravatar Quoth Amar

Fantastic. Greta work!


Gravatar Quoth greips

great work! :-)


Gravatar Quoth Trevor Nederlof

Thank you so much for this I found this method very effective to show people and have an impact. When I cross reference something such as a content page from top content to cities to see all the cities who have viewed the content that exported data doesn’t work unfortunatly. Is there anyway possible I could display those cities on the globe? Go ahead and email me if you want.


Gravatar Quoth R Pool

I think this is great way to get into using Google Earth; I wouldn’t have known where to start without your help. My next problem is trying to figure out how to customize the display of the globe to my specific needs. FOr example, I want to be able to change the color of all the placemarkers, or perhaps all of those on one continent. It seems I should be able to select them where they are listed, perhaps make a folder or something, and change them all at once–and also be able to generate a list of those changed. I’d also like to be able to create a flat map as well.

Thanks for your help!


Gravatar Quoth Lieven

Nice.., the day GA becomes a tool that can handle in real time stats, then this could be a very nice marketing tool:)
A Question though, is it possible to add search phrases after the visits part?
f.e. New York city (44 visits, “twin towers_5,liberty island_15″) etc..)
That would be cool :)


Gravatar Quoth Lieven

ALWAYS A RECENT/UPDATED KML on my own site ONLINE :

I linked Reget DL manager (https /user/pass) …every stat has exact url with paramaters ,auto schedule +batch to transform all stats into unique reports + converts to kml files + soon gonna edit some xml to show everything in a nice way ( UL also scheduled)
->every day at 22 o clock for 5 secs
->in 5secs everything is done
->DL/convert/UL - always updated KML online
->soon other stats


Gravatar Quoth Maarten

Best addition to google analytics I’ve seen so far. The normal Geo map overlay is useless since it doesn’t provide for zooming. This tool is great. Strange that the creative people at Google did not already develop this.
Thanks.


Gravatar Quoth Kinderfeestje

Perfect, now I can see where my visitors are from. Way better than the normal map.


Gravatar Quoth Gaston

Great job,

This code makes worth to see where my viewers come from.
I don’t understand, why Google didn’t come up with it..
Maybee they have a job for u ;)

I have to say, it didn’t work directly from the linux downloaded program, but via you web php it works great!


Gravatar Quoth Webmonster

The binary may not work on some systems because of library differences. Sorry if it doesn’t work for any of you. The .cpp file should compile just fine, though.


Gravatar Quoth Matt

This works great…really allows the data to spread out and gives a better view of how many different places are accessing my site. Great work!


Gravatar Quoth Justin

Pretty cool stuff!


Gravatar Quoth AlasdairGF

I was so disappointed with the Analytics mapping… this utility helps an awful lot. Favourite thing: So easy! Really a couple of basic steps. Least favourite thing: Not really helpful for smaller-scale local mapping - though that’s probably the fault of the data provided by Analytics rather than the conversion. Thanks, Scurvy Jake!


Gravatar Quoth JW

Awesome! Once again, I’m proven that I’m not the smartest guy in the world.

One thing…from a marketing perspective, if the ‘Places’ bar could show countries and expand to cities, it would help more to show to which languages a website should be translated than simply the ‘cities’ view does.


Gravatar Quoth Pat O'Malley

Great job! I was looking for something to give me a better view of my visitors geographically since Google Analytics gives too high level a view. Thanks for the script!


Gravatar Quoth Theodore

Hi All Experts,
Does anyone use google earth images as ground image planes for use in aerial scenes. I know how to stitch them together but are there any tools or tricks to make sure that the images are at the same height, angle and such to make sure they stitch well. I know in the pro version you can get bigger images but im not going to pay for the pro version when i could stitch multiple images together…


Gravatar Quoth somnath ray

Hi,

this is excellent… i was so amazed that google didnt incorporate this into analytics in the first place.

i have a question though.. the locations that it shows are the server locations.. is it not possible to pinpoint the exact ISp on the map?

Best.. and an excellent job done.. congratulations
Somnath ray


Gravatar Quoth Webmonster

Apparently Google Analytics only gets a general area for the IP address it records, probably because that’s all the more specific the information is. This may improve in the future, but for now we must be content with what we have.


Gravatar Quoth Faaborg

Interactive 3D accelerated ego tripping :)


Gravatar Quoth Ramon

Scurvy Jake, thanks a lot, man! The data looks great in Mac OS X’s version of Google Earth.


Gravatar Quoth Webmonster

Thanks, I appreciate you stopping by. Glad to hear it works in Mac, too.


Gravatar Quoth Bill

Thanks! Nice tool. Is there some way to associate the ISP with the server?


Gravatar Quoth Webmonster

Not that I’ve seen, Bill. The data that comes from Google Analytics doesn’t contain much more than the Lat/Lon coordinates and the area name.


Gravatar Quoth Frank Taylor

I’m using it again…


Gravatar Quoth Canuck

Very cool. Worked like a charm!


Gravatar Quoth Chris

Nice work! Looks great in GE 4. Thanks for the tool. :)


Gravatar Quoth David

Very nice. Finally a way to see all your traffic not just chunks of 500.


Gravatar Quoth RusslandJournal

Very interesting. This would be cool to integrate in Analytics.


Gravatar Quoth Shea

Great tool, thanks for the time saver!


Gravatar Quoth Peter

Well what can I say - wow! This has just made a research project I’m doing at work much more interesting and intuitive.

I’m looking into international development for an Arts festival and I’m hoping to be able to show where people actually came from along with where they looked at the web site from. This just cut out 90% of the work and the result is 90% better!

On another note, I’d love to be able to see the Google Analytics data across time using Google Earth’s ‘time shift’ feature. Of course this would involve stitching together several exports from Analytics.

Congratulations and thank you for a very useful tool!


Gravatar Quoth Webmonster

Thanks, I’m glad everyone likes it so much!

Since release, I’ve been published in a Japanese book on Google Earth, had new versions submitted to me, and tons of great comments. I hope this helps Google realize that the short development time it takes to tie Google Analytics to Google Earth is worth its weight in gold.

Do you hear me Google?


Gravatar Quoth StefanSeiz.com» Blog Archive » Website Statistics in Google Earth

[...] Cord wrote a very nice little converter which takes a tab-text file, exported out of your Google Analytics Geo Map Report and converts it [...]


Gravatar Quoth Matt H

nice work on this app, was nice this data on Google Earth.


Gravatar Quoth Travis Cooper

Your app is a godsend for my and my friend who can read the geo map report very well. Thank you so much!


Gravatar Quoth Nebojsa Stanojevic

The best thing for trackin so far!!!!!!!!!!!!
UaUUUUUUU
well done!


Gravatar Quoth LB

i made simple java app for the new interface (detail: city level map overlay)

http://www.thinktanksolutions.be/GA2GEConvertorNewInterface.jar


Gravatar Quoth snowland.se » Google: Analytics2KML

[...] Hittade ett inlägg om hur man kan göra om Google Analytics-data till en Google Earth-KML… http://bogomip.net/blog/google-analytics-and-google-earth/ [...]


Gravatar Quoth Statistiche di Google Analytics in 3D con Google Earth | spailab.net | spai paolo spinelli

[...] dei nostri siti conteggiate attraverso il servizio di statistiche gratuito Google Analytics. Jacob Cord ha sviluppato un piccolo programmino che riesce a convertire la funzione “Overlay carta [...]


Gravatar Quoth Johann Blake

A free web service is available that allows you to view Google Analytics data in Google Earth or in Google Maps. It is available at:

http://www.mobilgistix.com/web-services/Google_Analytics/google-earth-analytics.aspx


Gravatar Quoth Webmonster

Finally! Thanks a bunch for this information. The only reason I wrote this application was because I couldn’t get my Analytics information into Earth. Now that it appears they export in KML format, I guess this project is truly dead…


Gravatar Quoth Frank Taylor

Where did you see they are now supporting KML?


Gravatar Quoth Webmonster

Sorry, my bad. I guess I jumped the gun, I thought the XML export was in KML format. Turns out the website Johann mentioned just converts the XMl to KML, much like my program did.


Leave a Reply (Java required)—Gravatar friendly!