Device, app, web, stream and platform: dimensions & metrics (GA4)
2 min read

Device, app, web, stream and platform: dimensions & metrics (GA4)

The most important device, app and web dimensions and metrics for GA4 BigQuery export, like device category, mobile brand, browser, operation system, language and hostname.
Device, app, web, stream and platform: dimensions & 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 device dimensions

  • device.category
  • device.mobile_brand_name
  • device.mobile_model_name
  • device.mobile_marketing_name
  • device.mobile_os_hardware_model
  • device.operating_system
  • device.operating_system_version
  • device.vendor_id
  • device.advertising_id
  • device.language
  • device.is_limited_ad_tracking
  • device.time_zone_offset_seconds
  • device.browser
  • device.browser_version

Default app dimensions

  • app_info.id
  • app_info.version
  • app_info.install_store
  • app_info.firebase_app_id
  • app_info.install_source

Default web dimensions

  • device.web_info.browser
  • device.web_info.browser_version
  • device.web_info.hostname

Default stream & platform dimensions

  • stream_id
  • platform

Example query

select
    -- device.category (dimension | the device category (mobile, tablet, desktop))
    device.category as device_category,
    -- device.mobile_brand_name (dimension | the device brand name)
    device.mobile_brand_name,
    -- device.mobile_model_name (dimension | the device model name)
    device.mobile_model_name,
    -- device.mobile_marketing_name (dimension | the device marketing name)
    device.mobile_marketing_name,
    -- device.mobile_os_hardware_model (dimension | the device model information retrieved directly from the operating system)
    device.mobile_os_hardware_model,
    -- device.operating_system (dimension | the operating system of the device)
    device.operating_system,
    -- device.operating_system_version (dimension | the os version)
    device.operating_system_version,
    -- device.vendor_id (dimension | idfv (present only if idfa is not collected))
    device.vendor_id,
    -- device.advertising_id (dimension | advertising id/idfa)
    device.advertising_id,
    -- device.language (dimension | the os language)
    device.language,
    -- device.is_limited_ad_tracking (dimension | the device's limit ad tracking setting)
    device.is_limited_ad_tracking,
    -- device.time_zone_offset_seconds (dimension | the offset from gmt in seconds)
    device.time_zone_offset_seconds,
    -- device.browser (dimension | the browser in which the user viewed content)
    device.browser,
    -- device.browser_version (dimension | the version of the browser in which the user viewed content)
    device.browser_version,
    -- device.web_info.browser (dimension | the browser in which the user viewed content)
    device.web_info.browser as web_browser,
    -- device.web_info.browser_version (dimension | the version of the browser in which the user viewed content)
    device.web_info.browser_version as web_browser_version,
    -- device.web_info.hostname (dimension | the hostname associated with the logged event)
    device.web_info.hostname,
    -- app_info.id (dimension | the package name or bundle id of the app)
    app_info.id,
    -- app_info.version (dimension | the app's versionname (android) or short bundle version)
    app_info.version,
    -- app_info.install_store (dimension | the store that installed the app)
    app_info.install_store,
    -- app_info.firebase_app_id (dimension | the firebase app id associated with the app)
    app_info.firebase_app_id,
    -- app_info.install_source (dimension | the source that installed the app)
    app_info.install_source,
    -- stream_id (dimension | the numeric id of the stream)
    stream_id,
    -- platform (dimension | web or app platform)
    platform
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.