Searching data / Working in the search window / Use case: eCommerce behavior analysis / Step 3. Country distribution / Geolocate IP addresses
Geolocate IP addresses
Devo geolocation functions enable you to add more detailed geolocation values to the records and put the log information into an actual map.
- You can use the same previous query. We will get the latitude and longitude values corresponding to the IP addresses of the clientIpAddress column. Select it, click the Create column icon on the toolbar and use the Geolocated Latitude (mmlatitude) operation and add the clientIpAddress column as an argument. Do the same using the Geolocated Longitude (mmlongitude) operation. Name the new columns Latitude and Longitude.
- Group the data by latitude and longitude simultaneously. Select the Group icon on the toolbar and select No time-based grouping. Add the Latitude and Longitude columns as arguments, then click Group by.
- Add a counter to count the number of events per lat-lon couple. Select the Aggregation icon on the toolbar and click Aggregate.
With this set of data defined, you can now generate different types of maps.
Flat world map by coordinates
- Select the gear icon on the toolbar, then click Charts → Maps → Flat world map by coordinates.
- Drag and drop the columns to the required fields.
- The IP addresses are plotted on the world map.
Google heat map
Another option is to use a Google heat map. This type of graph provides a better visual display about where the users are logged from.
- On a heat map, you can represent more than one data set at a time. For example, you can add the countryName column to the grouping we applied before to add it to the graph. To edit the grouping, click the pencil icon in the node of the applied operations bar, and add a new argument.
- Select the Toggle Search Tree icon from the toolbar and go back to the final node. Now select the gear icon from the toolbar, then click Charts → Maps → Google heat map.
- Drag and drop the columns to the required fields.
- The IP addresses are plotted on the map, including the country names on the top legend.