Change Bubble Size and Colour in a Google Data Studio Map using Parameters

In this post I’ll show how you can change Bubble Size and Colour in a Google Map in a Data Studio report. This method using two parameters to let you switch between which metrics are displayed on the map.

Below is a video showing what you can do in Google Data Studio.

Step 1: Create a Parameter that lets you switch between Country, Region and City

So I’ve covered this topic in a separate blog post; How to switch Google Map dimensions using a Parameter in Data Studio. So I’ll just go over the basic things to do here.

This example using Google Analytics data that is added to Google Data Studio using the Extract Data connector.

Create a parameter called ‘Geographic Level’. The List of values are Country, Region and City.

parameter geographic

Then create a calculated field based off of just the parameter called geo field. As shown below.

Finally create a new dimension called Geo Dimension made using a CASE statement. Here is the CASE statement.

CASE geo_field
WHEN 'Country' THEN Country
WHEN 'Region' THEN Region
WHEN 'City' THEN City

And this is how it should look when written out as a calculated field.

Step 2: Create two identical Parameters

So for this next step you need to create TWO identical parameters. Name one parameter ‘Bubble Size’ and the other parameter ‘Bubble Colour.

Choose the Data type to be text and list the following values;
– Sessions
– Users
– Page Views
– Goal Completions
– Goal Conversion Rate

Step 3: Create two identical calculated fields based on parameters

Once you’ve created the two identical parameters, you need create two identical calculated fields based off the parameters.

Give them different names and base one off of Bubble Size and the other off of Bubble Colour.

Step 4: Create two identical Dimensions

So the next step is to create two dimensions. Each is identical but is based off of the different calculated field.

See the screenshots below.

Here is the CASE statement you can copy and paste to replicated these fields.

CASE map_field_1
WHEN 'Sessions' THEN Sessions
WHEN 'Users' THEN Users
WHEN 'Page Views' THEN Page Views
WHEN 'Goal Completions' THEN Goal Completions
WHEN 'Goal Conversion Rate' THEN Goal Conversion Rate

Once you have created these we are good to go!

Step 5: Create the Google Map with our newly created Dimension and Metrics

So now that we have our new dimension and metrics we can build out our Google Map.

Set it up as follows;
Location = Geo dimension
Metric Size = Map Metric 1
Metric Colour = Map Metric 2

So in order to use this Google Map effectively, we need to add in three parameter controls.

  • Geographic Level to switch between Country, Region and City
  • Bubble Size to switch between which metric is displayed as size
  • Bubble Colour to switch between which metric is displayed as colour

Step 6: Using the Google Data Studio report

Now that we’ve gone through the ordeal of creating all these different parameters, we can use the finished Google Data Studio report.

Note: You will NOT be able to see or interact with the Google Map while viewing the report embedded.

You will need to open it in Google Data Studio. Here is the link to the report;

My Other Blog Posts

If you liked this post about (checks notes) how Change Bubble Size and Colour in a Google Data Studio Map using Parameters you might enjoy these other blog posts.

Michael Howe-Ely