Google Analytics and Google Earth
Posted in
Afternoon watch, 7 bells (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!

62 Comments »

62 Responses to “Google Analytics and Google Earth”

  1. Matt H says:

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

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

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

  4. LB says:

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

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

  5. [...] 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/ [...]

  6. [...] 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 [...]

  7. Johann Blake says:

    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

  8. Webmonster says:

    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...

  9. Frank Taylor says:

    Where did you see they are now supporting KML?

  10. Webmonster says:

    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.

  11. 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.

  12. Hey man I wanted to write and say i love reading your blog!

Leave a Reply