Starting with Google Analytics mapping
We had a request a couple of days ago to pull together a map that showed which countries visitors to the library website were coming from.   On the face of it – that’s reasonably straightforward as you can use the Map Overlay feature in Google Analytics to show an Intensity Map of where visitors come from.

Google Analytics map overlay

But when we looked at it in more detail we realised that there isn’t all that much flexibility about what the map looks like.  Although it works fine online if you are going to use the image as a JPEG then you lose the features that you get from the mouseovers.  In our case there’s a lot of UK usage but usage outside the UK soon starts to reduce to quite small numbers which only show up as a very light shading on the map.  There is an option to show cities on the map which show up as dots, but there’s limited flexibility in customising the map, you don’t seem to be able to have markers for the countries for example.  So we started to look for alternative ways of mapping the data to see if we could get a better format.

What else can you do?
Fortunately it is quite easy to extract the data from Google Analytics in a way that can be used by other tools.  So the first step is to export the data in CSV format.  Once the data is in CSV format you can edit the file, so we took out some of the other data that Google Analytics includes – such as Average Time on Site and Bounce Rate that we didn’t need for this map.  Then we started looking at a few other tools to use for mapping the data – Google Fusion tables and Google Maps to start with, to see what they would look like or whether they allow you to do anything you can’t do with Google Analytics.

Google Fusion tables http://www.google.com/fusiontables/Home
This tool allows you to import data in a variety of file formats – .CSV, .XLS, .XLSX, .ODS and .KML, as well as Google spreadsheets.  .CSV and .KML allow file sizes of up to 100mb, the others only 1mb.  Using the tool is quite straightforward,  you’ll need a Google Account and then from the homepage of Google fusion tables click the New table – Import table option.  Then browse to find and upload the file.  We uploaded the CSV file from Google Analytics. Google Fusion tables mapOnce you have your data imported you can use the visualize option and choose from a couple of map-types (Map or Intensity Map).  On the Map option it’s possible to change the marker type to a more prominent marker or change the colour used.  The intensity map is essentially the same as the default you get on Google Analytics.  You can also zoom in and out but if you zoom out you get multiple versions of the world repeated.  A useful feature is that you can export your data in KML format which is used by Google mapping tools such as Google Maps.

Google Maps http://maps.google.co.uk/
Taking the KML file created through Google Fusion tables you can upload it into Google Maps. Google MapsAgain you need a Google account, and there are very similar options to the other Google tools, but with slight variations.  For example, when you zoom out you get the continents repeated but the markers only appear once.  to create your map click on the MyMaps option and then upload the KML file.   The maps are optimised for viewing online and if you want to produce a map that can be output as a JPEG file they aren’t ideal as you can’t really get a full screen sized map with the countries displayed.

Producing an image for use in a document
What you end up with by taking a screenshot is something that looks like this (on the left from Google Maps) Google Maps screenshotor this (on the right from Google Fusion tables). Google Fusion tablesIn Google Fusion tables you can change the marker style but you don’t seem to be able to do so in Google Maps.  Neither are ideal unless they are being used online.  Although they are good for an overview of the scope of the globe that is covered you can’t easily see all the countries to show which ones you have had visitors from.  I haven’t come across a full screen version that would make it easy to take a screenshot.  In an ideal world you would be able to set the size of the map, define whether you had one copy of the globe or several, choose whether to display the country names, and configure exactly how the markers or colouring is shown.  It would be good if there was consistency between the various Google tools so you could do the same things for all the mapping tools.

Next steps
Although the Google tools don’t do everything you’d want they are pretty easy to use to provide a quick map of visitor locations.  It only takes a few minutes to extract the data from Google Analytics and load it into Google Fusion tables and then present it in a map.  There are other tools around, such as Zeemaps, which may bear investigation to see if they have a more suitable output.

Advertisements