GOV.UK App GA4 flattened table
The GOV.UK App GA4 flattened table contains production GOV.UK GA4 data processed into a flat format.
This table is created from the raw data exported into BigQuery and contains most, but not all, of the same fields. This flattened dataset is easier and more efficient to query, so should be used for most analysis and reporting.
Content
The first date for which there is data in the flattened table is the 11th November 2024. Note that the quality of the early data may be lower than desired as our GA4 implementation was still actively developed after the App’s launch in November 2025.
This table is a partitioned table, and is partitioned on event_date.
A WHERE clause to specify which partitions are needed is required when querying this table - for example, WHERE event_date = "2025-11-11".
Access
GDS staff can request access to this data from the GOV.UK App team.
Location
This data can be found in BigQuery in the govuk-app-production.flattened_dataset.partitioned_flattened_events table.
Set-up
Data collection and processing
This flattened table is the result of several steps of processing:
- The GOV.UK App GA4 production raw data is received from Google. This arrives sharded into daily tables, and the data within these tables is nested. We store this raw data in BigQuery
- The raw data is processed into a partitioned table that is partitioned on event_date and clustered on event_name (though the data is still nested)
- The partitioned nested data is flattened into the partitioned flattened table detailed on this page
graph TD A[Raw sharded data from Google] --> B B[Partitioned raw event data] B --> C[Partitioned flattened data]
This processing occurs within DataForm in the govuk-app-production project. The DataForm script is compiled at 7am UTC and run several times thoughout the day to ensure the data is processed soon after it arrives.
The full code used can be viewed in Github. All staff in the ‘performance analysts’ group in the Alphagov GitHub organisation are able to read the repo but only select analysts and data engineers working on GOV.UK App GA4 have access to publish changes. Branch protection rules are in place to ensure changes cannot be made without review and approval. Contact the GOV.UK App team if you would like to make changes to the GOV.UK App GA4 data processing.
Schema
| field name | type | mode | description |
|---|---|---|---|
| event_date | DATE | NULLABLE | The date when the event was logged, formatted as YYYYMMDD |
| user_pseudo_id | STRING | NULLABLE | The pseudonymous ID for a user on a particular client |
| user_id | STRING | NULLABLE | A unique ID to associate a single user with engagement via multiple devices. Not currently in use on the GOV.UK App |
| unique_session_id | STRING | NULLABLE | The user_pseudo_id concatenated with the ga_session_id to create a unique session ID |
| ga_sessionid | INTEGER | NULLABLE | A session ID generated by GA4. This corresponds to the time the session started and is not necessarily unqiue |
| ga_session_number | INTEGER | NULLABLE | The number of sessions that a user has started up to the current session e.g. ‘5’ for the user’s fifth session |
| event_name | STRING | NULLABLE | The name of the event |
| event_timestamp | INTEGER | NULLABLE | The time (in microseconds, UTC) when the event was logged |
| timestamp | INTEGER | NULLABLE | The Unix timestamp in milliseconds. This is a custom dimension, pushed with every event, unlike the default event_timestamp above |
| batch_page_id | INTEGER | NULLABLE | A (Google-created) unique identifier for each page view, allowing for the reconstruction of user interactions within a specific page |
| batch_event_index | INTEGER | NULLABLE | A number indicating the sequential order of each event within a batch based on their order of occurrence on the device |
| batch_ordering_id | INTEGER | NULLABLE | A monotonically increasing number assigned to each network request sent from a page |
| screen_title | STRING | NULLABLE | The title assigned to the screen the user is on when the event is fired |
| firebase_screen | STRING | NULLABLE | The current screen’s name, derived from the name set for a screen using Firebase |
| firebase_screen_class | STRING | NULLABLE | The current screen’s name, derived from the class name of the UIViewController or Activity in focus |
| firebase_screen_id | STRING | NULLABLE | An identifier for the current screen |
| firebase_previous_screen | STRING | NULLABLE | The name of the previous screen the user was on |
| firebase_previous_class | STRING | NULLABLE | The class of the previous screen the user was on |
| firebase_event_origin | STRING | NULLABLE | Differentiates events based on their collection method or source within the app environment |
| session_engaged | STRING | NULLABLE | A flag to indicate whether or not the session was engaged e.g. ‘1’ when the event belongs to a session deemed to be engaged. This begins as ‘0’ for all events in a given session then flips to ‘1’ for all events after the session has become engaged |
| method | STRING | NULLABLE | |
| text | STRING | NULLABLE | Identifying text for the specific item the user interacted with |
| link_url | STRING | NULLABLE | The href attribute of a link (sent with navigation events) |
| search_results | STRING | NULLABLE | The number of results returned by the search |
| engagement_time_msec | INTEGER | NULLABLE | The time the user has been engaged in milliseconds |
| event_campaign | STRING | NULLABLE | The campaign information associated with this event |
| type | STRING | NULLABLE | The type of feature the user interacted with e.g. accordion, footer etc |
| event_source | STRING | NULLABLE | The source information associated with this event |
| session_source | STRING | NULLABLE | The source information associated with this session (the first source of the session) |
| term | STRING | NULLABLE | The ‘term’ campaign parameter, typically used with paid search to note the keywords for an ad |
| event_medium | STRING | NULLABLE | The medium information associated with this event |
| session_medium | STRING | NULLABLE | The medium information associated with this session (the first medium of the session) |
| event_previous_timestamp | INTEGER | NULLABLE | The time (in microseconds, UTC) the event was previously logged on the client |
| event_bundle_sequence_id | INTEGER | NULLABLE | The sequential ID of the bundle in which these events were sent to GA4 |
| event_server_timestamp_offset | INTEGER | NULLABLE | Timestamp offset between collection time and upload time in microseconds |
| user_first_touch_timestamp | INTEGER | NULLABLE | The time (in microseconds) when the user first visited the site |
| category | STRING | NULLABLE | The device category (mobile, tablet, desktop) |
| mobile_brand_name | STRING | NULLABLE | The device brand name |
| mobile_model_name | STRING | NULLABLE | The device model name |
| mobile_marketing_name | STRING | NULLABLE | The device marketing name |
| mobile_os_hardware_model | STRING | NULLABLE | The device model information retrieved directly from the operating system |
| operating_system | STRING | NULLABLE | The operating system of the device |
| operating_system_version | STRING | NULLABLE | The OS version |
| language | STRING | NULLABLE | The OS language |
| is_limited_ad_tracking | STRING | NULLABLE | The device’s Limit Ad Tracking setting |
| time_zone_offset_seconds | INTEGER | NULLABLE | The offset from GMT in seconds |
| browser | STRING | NULLABLE | The browser in which the user viewed content |
| browser_version | STRING | NULLABLE | The version of the browser in which the user viewed content |
| hostname | STRING | NULLABLE | The hostname associated with the logged event |
| continent | STRING | NULLABLE | The continent from which events were reported, based on IP address e.g. ‘Europe’ |
| country | STRING | NULLABLE | The country from which events were reported, based on IP address e.g. ‘United Kingdom’ |
| region | STRING | NULLABLE | The region from which events were reported, based on IP address e.g. ‘England’ |
| city | STRING | NULLABLE | The city from which events were reported, based on IP address e.g. ‘Birmingham’ |
| sub_continent | STRING | NULLABLE | The subcontinent from which events were reported, based on IP address e.g. ‘Northern Europe’ |
| metro | STRING | NULLABLE | The metro from which events were reported, based on IP address e.g. ‘Midlands’ |
| first_user_campaign | STRING | NULLABLE | The campaign through which this user first landed on GOV.UK |
| first_user_medium | STRING | NULLABLE | The medium through which this user first landed on GOV.UK |
| first_user_source | STRING | NULLABLE | The source through which this user first landed on GOV.UK |
| stream_id | STRING | NULLABLE | The numeric ID of the data stream from which the event originated |
| platform | STRING | NULLABLE | The data stream platform (Web, IOS or Android) from which the event originated |
| previous_app_version | STRING | NULLABLE | For the app_update event, this parameter signifies the previous application version |
| fatal | INTEGER | NULLABLE | Whether an exception was fatal |
| system_app | INTEGER | NULLABLE | (Android Only) Whether or not a first_open pertains to a system app |
| update_with_analytics | INTEGER | NULLABLE | Signifies that the first_open event was logged due to an update to a new version of the app that integrates Analytics |
| previous_first_open_count | INTEGER | NULLABLE | The number of times the first_open event has been logged |
| system_app_update | INTEGER | NULLABLE | (Android Only) Whether or not a first_open pertains to a system app update |
| section | STRING | NULLABLE | Used to distinguish between multiple sections within an interaction element where the text property is not granular enough |
| action | STRING | NULLABLE | The action the user has taken e.g. ‘opened’ |
| debug_mode | INTEGER | NULLABLE | A flag to indicate whether Google Tag Manager’s debug mode was being used to send these events e.g. ‘1’ when debug mode was in use |
| engaged_session_event | INTEGER | NULLABLE | The number of sessions the user is engaged in. Expect it to always be ‘1’ on the GOV.UK App as we do not use a user ID so cannot tell if a user visits the website from many devices |
| entrances | INTEGER | NULLABLE | A flag to indicate an entrance, where ‘1’ indicates an entrance |
| firebase_conversion | INTEGER | NULLABLE | A flag to indicate if an event is a firebase conversion. Not in use |
| gclid | STRING | NULLABLE | The Google click identifier that was collected with the event |
| gclsrc | STRING | NULLABLE | The Google click identifier that indicates the source of the click ID |
| dclid | STRING | NULLABLE | The Google Marketing Platform (GMP) identifier that was collected with the event |
| ignore_referrer | STRING | NULLABLE | Value of the ignore_referrer parameter, a flag used by Google to determine whether or not to use a given referrer to generate attribution information |
| content | STRING | NULLABLE | The ‘content’ campaign parameter, typically used to differentiate between two ads or links that point to the same URL |
| campaign_id | STRING | NULLABLE | The ID of a promotion or marketing campaign that led to a key event |
| ab_test | STRING | NULLABLE | The content attribute of the <meta name="govuk:ab-test"> tag
|
| percent_scrolled | INTEGER | NULLABLE | The percentage scroll depth the user has reached |
| manual_campaign_id | STRING | NULLABLE | The manual campaign id (utm_id) that was collected with the event |
| manual_campaign_name | STRING | NULLABLE | The manual campaign name (utm_campaign) that was collected with the event |
| manual_source | STRING | NULLABLE | The manual campaign source (utm_source) that was collected with the event. Also includes parsed parameters from referral params, not just UTM values |
| manual_medium | STRING | NULLABLE | The manual campaign medium (utm_medium) that was collected with the event. Also includes parsed parameters from referral params, not just UTM values |
| manual_term | STRING | NULLABLE | The manual campaign keyword/term (utm_term) that was collected with the event |
| manual_content | STRING | NULLABLE | The manual content keyword/term (utm_content) that was collected with the event |
| manual_source_platform | STRING | NULLABLE | Indicates the platform from which the traffic originated |
| manual_creative_format | STRING | NULLABLE | Like ‘content’, used to manually tag the format of a creative (e.g., “image,” “video,” “text”) to track different versions of ads |
| manual_marketing_tactic | STRING | NULLABLE | The manual marketing tactic parameter, used to send information related to your marketing tactics (for example, targeting strategies) |
| collected_traffic_source_gclid | STRING | NULLABLE | The Google click identifier that was collected with the event |
| collected_traffic_source_dclid | STRING | NULLABLE | The DoubleClick Click Identifier for Display and Video 360 and Campaign Manager 360 that was collected with the event |
| collected_traffic_source_srsltid | STRING | NULLABLE | The Google Merchant Center identifier that was collected with the event |
| is_active_user | BOOLEAN | NULLABLE | Whether the user was active (True) or inactive (False) at any point in the calendar day |
| outbound | STRING | NULLABLE | ‘True’ if a link clicked leads away from the GOV.UK App |
| traffic_type | STRING | NULLABLE | The traffic_type parameter set in the GA4 interface or in Google Tag Manager, to help us filter out internal or developer traffic and spam |
| app_info_id | STRING | NULLABLE | Identifies the mobile application from which event data originated - for Android apps, the package name, and for iOS the bundle ID of the app |
| app_info_version | STRING | NULLABLE | The mobile app’s versionName (Android) or short bundle version (iOS) in which an event occurred |
| app_info_install_store | STRING | NULLABLE | The store that installed the app |
| app_info_firebase_app | STRING | NULLABLE | The Firebase App ID associated with the app |
| app_info_install_source | STRING | NULLABLE | The store that installed the app |
| topics_customised | STRING | NULLABLE | Custom user property which indicates whether or not a user has customised their topics |
| first_open_time | INTEGER | NULLABLE | User property automatically collected for app streams (iOS and Android) that records the timestamp of the first time a user opens the app |
| item_list_name | STRING | NULLABLE | The name of the item list |
| item_list_id | STRING | NULLABLE | The id of the item list |
| item_id | STRING | NULLABLE | The id of the item |
| item_name | STRING | NULLABLE | The name of an item - on GOV.UK, the link text of a search result |
| item_list_index | STRING | NULLABLE | The index (number of total items) shown to the user in a given list |
Retention
At present, there is no default table expiry set up for this table, and no agreed data retention period.