Creating geo map widgets

This guide explains how to create a geo map widget.

Introduction

A geo map widget displays a metric (such as Clicks or Impressions) on a map, showing where the metric took place. This guide explains the two ways to display data on a geo map widget:

Bubbles on a map

This geo map displays the chosen metric as a bubble on the map, where the larger the bubble, the bigger the metric value. This option requires latitude and longitude data values.

Regional heat map

This geo map displays the chosen metric as a heat map across the regions of the relevant country. This option requires ISO region codes to populate the geo map.

Scope

The two types of geo map widgets require different enrichment scripts and data sets in the data source. This guide will outline all the requirements in the following sections:

Creating a geo map widget to display bubbles on a map

Introduction

The example geo map widget below displays the number of clicks an ad received in cities in the country of Austria. Each of these cities is represented as a bubble, where the bigger the bubble, the more clicks an ad received. For example, Graz has a bigger bubble compared to Lienz, showing more ad clicks in Graz compared to Lienz.

A Geo map widget of Austria that displays the number of clicks an ad received within specific cities.

Prerequisites

Before you complete the procedure in this guide, perform all of the following actions:

  • Ensure the data source from which you are collecting data contains the following location fields:

    • Country - This is to display the name of the country in the geo map title.

    • City - This is to display the names of the cities on the geo map.

    • Latitude - This is used to create the required geolocation dimension.

    • Longitude - This is used to create the required geolocation dimension.

  • (Optional) To increase performance when displaying data, ensure the latitude and longitude values are set to no more than two decimal places. Create an enrichment script that rounds the latitude and longitude values to two decimal places. For more information, see Creating rounding enrichment script. If you choose to use the rounding enrichment script, ensure it runs before the geolocation-creation script.

  • Create an enrichment script that combines latitude and longitude into a single dimension. This dimension is called geolocation. For more information, see Creating geolocation enrichment scripts.

  • Ensure the data extract contains the following metrics and dimensions:

    • country (dimension)

    • city (dimension)

    • geolocation (dimension created with enrichment script)

    • The metric to be displayed in the geo map (for example, Clicks or Impressions)

Procedure

To create a geo map widget that displays bubbles on a geo map, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Data Explorer.

  2. Next to the View tabs at the top of the page, click Create new view.

  3. In the secondary menu, select the following dimensions.

    • Country

    • City

    • Geolocations

  4. In the list in the secondary menu, select the metric to be displayed in the geo map widget. This guide uses Clicks as an example.

  5. In the middle of the page, in the Dimensions panel, ensure the dimensions are in the following order:

    • Country > City > Geolocations

  6. In the table that you have created in the middle of the page, click on one of the values in the Geolocations row within the Clicks column to see visualization options. Click Geolocationses by City of Country {Country Name}.

    This guide uses Austria as the {Country Name}, so the visualization option would be Geolocationses by City of Country Austria.

  7. Above the widget that you have created, click Geo map.

As a result, a geo map widget is created, displaying your chosen metric (in this example, Clicks) next to the corresponding cities.

Configuring a geo map widget to display city names

To configure the geo map widget to look like the example shown above, follow these steps:

  1. To the right of the chart widget, select General from the Settings drop-down menu.

  2. In Region, select the country to display in the geo map widget. This guide uses Austria as an example.

  3. To the right of the chart widget, select Geolocationses by City of Austria from the Settingsdrop-down menu.

  4. In Flatten data points, enable the toggle.

  5. (Optional) In Metric name, change the name of the metric displayed in the geo map widget. This guide uses Clicks as an example.

  6. In Data labels, enable the Show data labels toggle.

  7. To the right of the chart widget, select General from the Settings drop-down menu again.

  8. In Data labels, enable the Data labels name toggle. This displays the name of the city next to the metric bubble.

  9. (Optional) In Data labels, disable the Data labels value toggle. This hides the metric value from the data label so only the city name is displayed.

As a result, the geo map widget has been configured and will look like the example above. You can now add the widget to a dashboard. For more information, see Adding widgets to a dashboard in Data Explorer.

Creating a geo map widget that displays a regional heat map

Introduction

The example geo map widget below displays the number of clicks an ad received in regions across the country of Austria as a heat map. Each of these regions is represented with a color corresponding to the number of ad clicks, where the stronger or hotter the color of the a region is, the more ad clicks took place there. For example, the Austrian region Wien is more red compared to Tirol, showing that there were more ad clicks in Wien compared to Tirol.

A Geo map widget of Austria that displays the number of clicks an ad received as a region heat map.

Prerequisites

Before you complete the procedure in this guide, perform all of the following actions:

  • Ensure the data source from which you are collecting data contains the following location fields:

    • Country - This is to display the name of the country in the geo map title.

    • Region - This is so a mapping table will match a region to the correct ISO region code.

  • Create a mapping table with the ISO region codes for the country to display as a geo map. This guide uses Austria as an example. For more information, see Creating a mapping table that contains ISO region codes.

  • Create an enrichment script that applies the mapping table to the data extract to create the required dimension. This dimension is called ISO region code. For more information, see Creating an enrichment script to add ISO region codes to your data extract.

  • Ensure the data extract contains the following metrics and dimensions:

    • country (dimension)

    • iso region code (dimension created with enrichment script)

    • The metric to be displayed in the geo map (for example, Clicks or Impressions)

Procedure

To create a geo map widget that displays bubbles on a geo map, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Data Explorer.

  2. Next to the View tabs at the top of the page, click Create new view.

  3. In the list in the secondary menu, select the following dimensions.

    • Country

    • ISO Region Code

  4. In the list in the secondary menu, select the metric to be displayed in the geo map widget. This guide uses Clicks as an example.

  5. In the middle of the page, in the Dimensions panel, ensure the dimensions are in the following order:

    • Country > ISO Region Code

  6. In the table that you have created in the middle of the page, click on one of the values in the ISO Region Code row within the Clicks column to see visualization options. Click ISO Region Code of Country {Country Name}.

    This guide uses Austria as the {Country Name}, so the visualization option would be ISO Region Code of Country Austria.

  7. Above the widget that you have created, click Geo map.

As a result, a geo map widget is created, displaying your chosen metric (in this example, Clicks) next to the corresponding cities.

Configuring a geo map widget to display region names

To configure the geo map widget to look like the example shown above, follow these steps:

  1. To the right of the chart widget, select General from the Settings drop-down menu.

  2. In Region, select the country to display in the geo map widget. This guide uses Austria as an example.

  3. To the right of the chart widget, select ISO Region Code of Country Austria from the Settings drop-down menu.

  4. (Optional) In Metric name, change the name of the metric displayed in the geo map widget. This guide uses Clicks as an example.

  5. In Data labels, enable the Show data labels toggle.

  6. To the right of the chart widget, select General from the Settings drop-down menu again.

  7. In Data labels, enable the Data labels name toggle. This displays the name of the region within the relevant section of the map.

  8. (Optional) In Data labels, disable the Data labels value toggle. This hides the metric value from the data label so only the region name is shown.

As a result, the geo map widget has been configured and will look like the example above. You can now add the widget to a dashboard. For more information, see Adding widgets to a dashboard in Data Explorer.