Geo location: dimension & metrics (GA4)
1 min read

Geo location: dimension & metrics (GA4)

The most important geo location dimensions and metrics for GA4 BigQuery export, like continent, country, region and city.
Geo location: dimension & metrics (GA4)

A lot of Google Analytics 4 data can be derived straight from the tables without performing calculations on the data. With the help of unnest and parse for dates or timestamps we can do the trick.

Look at the -- comments in the example query for names and definitions and copy the part you need from the select clause. Make sure that you also add any additional conditions (i.e. with, from, where, group by, having and order by) that are necessary to calculate the results correctly.

Default geo dimensions

  • geo.continent
  • geo.sub_continent
  • geo.country
  • geo.region
  • geo.city
  • geo.metro

Example query

select
    -- geo.continent (dimension | the continent from which events were reported, based on ip address)
    geo.continent,
    -- geo.sub_continent (dimension | the subcontinent from which events were reported, based on ip address)
    geo.sub_continent,
    -- geo.country (dimension | the country from which events were reported, based on ip address)
    geo.country,
     -- geo.region (dimension | the region from which events were reported, based on ip address)
    geo.region,
    -- geo.city (dimension | the city from which events were reported, based on ip address)
    geo.city,
    -- geo.metro (dimension | the metro from which events were reported, based on ip address)
     geo.metro
from
    -- change this to your google analytics 4 export location in bigquery
    `ga4bigquery.analytics_250794857.events_*`
where
    -- define static and/or dynamic start and end date
    _table_suffix between '20201101' and format_date('%Y%m%d',date_sub(current_date(), interval 1 day))

Enjoying this post? Subscribe to the GA4BigQuery newsletter!

You will receive regular updates (max 1x/week) straight in your inbox. You can unsubscribe anytime.