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.
Google does not allow us to send the geolocation parameter server-side. There are many advantages of server-side tracking, 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):
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.
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
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.
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.
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.
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.