Tutorial


How to visualize Google location data with Tableau

How to visualize Google location data with Tableau



ByJan Watermann

...

August 13, 2018

Visualizing Google location data with Tableau

In this tutorial, I want to make clear how easy it is to create location maps in Tableau. For this I reached out to one of our clients in Sydney, Australia, which wanted to visualize the location data of its drivers in order to understand the importance of different Australian motorways for its business. To make this happen I had access to direct Garmin GPS data of the driver and also the Google Account of his Android powered smartphone. Although the Garmin navigation device was mainly used for navigation, the driver constantly carried his company phone, which was permanently operated with location services. This tutorial will show how much Google knows about our lives and how easy it is to visualize Google location data without spending a single cent.

This can be done for free and takes approximately ten minutes. Data analysts will be able to use Tableau Desktop. For those without a Tableau license, we recommend Tableau Public, which is available for free under this link.

https://public.tableau.com/en-us/s/
Tableau Public is available for free

Once this is downloaded, we need to get our data source, which we want to connect to Tableau. To visualize the Google location history, we can request data directly from Google. You can find your location history on https://takeout.google.com. Just put a tick in the box with the tittle "Location history" (called Standortverlauf in German) and choose the format "JSON".

Google location data

Then we have to establish a data connection to our file. To do this we open Tableau Public and select "JSON file".

Establishing a data connection in Tableau

The file to be selected can then be found in the "Takeout" folder created by Google. Select the JSON file and open it.

Selecting a JSON file in Tableau

After that, Tableau asks which schema we want to select or what data we want to consider. Google not only stores the location data but also evaluates it according to different types. In the "activity" section an assigned value indicates the likelihood in which direction a user has moved. Quite interesting, isn't it? Since Datapony is going to use that data source for another visualization, we select all options and import them.

Selecting the right schema in Tableau

The imported data is now available in the worksheet. We just have to modify the coordinates a bit. For this we select both "latitudeE7" and "longitudeE7" and create a calculated field. Then we devide each value through 10,000,000.

Creating a calculated field in Tableau

We save the calculations as "lat" and "long".

Creating a calculated field in Tableau 2

Then we just have to tell Tableau that our computed fields are coordinates. For this we assign the roles "Latitude" and "Longitude" to our lat and long fields.

Changing the geographic role of a Tableau measure

Then we drag both fields into our sheet and place them on columns. Once this is done, we integrate the dimension "timestampMS" into our worksheet. Tableau's Show Me feature should now recognize that we want to create a map and select it once we've placed our dimension.

Tableau Show Me feature

That's the result we should get afterwards. The map shows a clear location history. Now we understand that the driver took the company's phone on two trips to Indonesia and New Zealand.

Creating a location map in Tableau

However, since we only concentrate on local data, we select Sydney in the Tableau search. What we see now is an unedited map, which is difficult to read. To see the best result, we recommend a smaller size for the location points and also a darker map.

For an even better looking map it is recommended to adjust the colour and saturation of the location data. We recommend a bright colour for locations and around 20% saturation.

Starting data viz in Tableau

Our result looks like this:

Final visualization of google location data

It is obvious that the Motorway A4 in Sydney is the most important road for our client. In addition, some streets in suburban Sydney are very important to the company. Now lets be honest: If we can extract all this from an Android smartphone, what will the Garmin navigation device tell us, which was used in the company for a longer period of time? 😉

Ready to gain valuable business insights?

Datapony empowers startups and medium-sized companies to start business intelligence projects. Our customer friendly subscription makes data analytics accesible to everyone. It comes even better. We built a platform that not only lets you transfer data securely to us, but also works as a viewer for all the dashboards we generate for you. That way no technical skills are required on your end. Sign up, transfer your data and let us know what you want to achieve with a visualization - Our Data Scientists will do the rest for you.

Sign up and get started!