How to create a Geolocation report in GA4

Updated on 2024-01-19

What's a geolocation report?

In Google Analytics you can look at the country and city a user came from, based on their IP address. This is a geolocation report.

Why can't I see location of purchase events?

Google does not allow us to send the geolocation parameter server-side. There are many advantages of server-side tracking for Shopify to Google Analytics, but this is one disadvantage. We will need to rely on a workaround of using pageviews of the thank you page.

GA4 Exploration section gives you possibility to present this data as a table or as a map. Once you're done following the steps outlined in this guide you'll be able to see your purchases on a world map like this (zooming in possible):

world map in ga4 geolocation purchases littledata

Creating the Exploration

If you'd rather watch a video guide on how to add geolocation (and device!) data to your Littledata-tracked purchases:



Create a Free Form Exploration with the following Dimensions & Metrics:

Dimensions: Page path, Query String
Metrics: Event Count, Active Users

Double click the Dimensions & Metrics added to create the report and view page paths & event counts.

Adding filters to the report

The next step is to add a filter to only see the page paths containing the phrase "thank_you".

By scrolling to the bottom of the 'Tab Settings' you can add a filter.

Select the Dimension 'Page path + Query String' -> Contains -> thank_you

Adding Active Users metric

After the filters are added, you will need to change the Value from 'Event count' to 'Active Users'. Simply remove 'Event Count' and drag 'Active Users' to Values.

The reason we made this change is because we don't want pages that have been loaded twice to skew our reports.

note:

Please note the number of purchases in this report will not fully match the purchase count in a standard GA4 report. This is because server-side tracked purchases are missing here.

Adding Town/City

Next, we will need to add a new Dimension for 'Town/City'. Once added, the 'Town/City' dimension can be fed into the report (either by double-clicking or dragging).

You will need to remove the dimension for 'Page path + query string' as that was only needed for filtering the data.

Re-name the report to 'Cities' for easier visualization.

Adding a GeoMap report

The last step is to duplicate Cities the report so that we can have a different view of the Geolocation. You can duplicate the report by selecting the arrow at the top:

By duplicating the report, and selecting GeoMap, you will be able to see the data on a map instead of a table.

Re-name the GeoMap exploration to 'World Map' for easier visualization.

Now you can view exactly where your customers are, and help you make better-informed decisions.