Skip to main content

GOV.UK GA4 flattened table

The 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 27th September 2022. Note that the quality of the early data may be lower than desired as our GA4 implementation was still in active development until early 2024.

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 = "2024-09-12".

Access

Everyone with a @digital.cabinet-office.gov.uk email address (all GDS staff) has access to the data by default.

In addition, everyone who requests and is granted access to the GOV.UK GA4 data will be given access to query this flattened dataset. More information can be found in our GA access policy.

Location

This data can be found in BigQuery in the ga4-analytics-352613.flattened_dataset.partitioned_flattened_events table.

As with the rest of our GOV.UK GA4 BigQuery data, this is located in the GA4 Analytics project.

Set-up

Data collection and processing

This flattened table is the result of several steps of processing:

  1. The GOV.UK 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
  2. 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)
  3. 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 gds-bq-processing project, but the data is written back into the ga4-analytics-352613 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 flattening 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 GA4 have access to publish changes. Branch protection rules are in place to ensure changes cannot be made without review and approval. Contact the Insights and Analytics team if you would like to make changes to the GOV.UK GA4 data processing.

More information on the processing can be found in the Policies and processes section.

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
event_name STRING NULLABLE The name of the GA4 event e.g. ‘page_view’, ‘navigation’, ‘session_start’, etc.
event_timestamp INTEGER NULLABLE The time (in microseconds, UTC) when the event was logged
unique_session_id STRING NULLABLE The user_pseudo_id concatenated with the ga_session_id to create a unique session ID
page_title STRING NULLABLE The title of the web page where the event occurred.
page_location STRING NULLABLE The full URL with the protocol, hostname, page path and query string
cleaned_page_location STRING NULLABLE The page path (the page_location without the protocol, hostname, and query string). If a canonical_url is available for this page, the cleaned_page_location will default to the canonical_url value (with the hostname removed), except for certain document types. The full code used can be seen on GitHub
ga_sessionid INTEGER NULLABLE A session ID generated by GA4. This corresponds to the time the session started and is not necessarily unique
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
primary_publishing_organisation STRING NULLABLE The organisation that published the content e.g. ‘Home Office’
page_referrer STRING NULLABLE The address of the webpage where a user clicked a link that sent them to the current page
cleaned_page_referrer STRING NULLABLE The path of the page referrer (the page_referrer without the protocol, hostname, and query string)
content_id STRING NULLABLE The content attribute of the <meta name="govuk:content-id"> tag
browse_topic STRING NULLABLE The content attribute of the <meta name="govuk:section"> tag
publishing_app STRING NULLABLE The content attribute of the <meta name="govuk:publishing-application"> tag e.g. ‘collections-publisher’
public_updated_at STRING NULLABLE The date of the last public update (the ‘public_updated_at’ field within the Content API and content attribute of the <meta name="govuk:public-updated-at"> tag)
updated_at STRING NULLABLE The date of the last internal update (the ‘updated_at’ field within the Content API and content attribute of the <meta name="govuk:updated-at"> tag)
first_published_at STRING NULLABLE The original publish date (the ‘first_published_at’ field within the Content API and content attribute of the <meta name="govuk:first-published-at"> tag)
taxonomy_all_ids STRING NULLABLE The content attribute of the <meta name="govuk:taxon-ids"> tag e.g. ‘a7f3005b-a3cd-4060-a127-725accb54f2e,65a25d2c-a0e5-4283-921d-c928babfb6e4’. Note: this field was blank between February and November 2023 when instead the full_taxonomy_ids_DEPRECATED field was populated with this information
status_code INTEGER NULLABLE The HTTP response status code
withdrawn STRING NULLABLE Default value of ‘false’, ‘true’ if <meta name="govuk:withdrawn" content="withdrawn"> tag is present
document_type STRING NULLABLE The content attribute of the <meta name="govuk:format"> tag
history STRING NULLABLE Default value of ‘false’, ‘true’ if <meta name="govuk:content-has-history" content="true"> tag is present
taxonomy_main_id STRING NULLABLE The content attribute of the <meta name="govuk:taxon-id"> tag
taxonomy_all STRING NULLABLE The content attribute of the <meta name="govuk:taxon-slugs"> tag. Note: this field was blank between February and November 2023, when instead the full_taxonomy_DEPRECATED field was populated with this information
taxonomy_main STRING NULLABLE The content attribute of the <meta name="govuk:taxon-slug"> tag
taxonomy_level_1 STRING NULLABLE The content attribute of the <meta name="govuk:themes"> tag
rendering_app STRING NULLABLE The content attribute of the <meta name="govuk:rendering-app"> tag
organisations STRING NULLABLE Publishing organisation IDs - the content attribute of the <meta name="govuk:analytics:organisations"> tag e.g. ‘
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 (lasts longer than 10 seconds, has a key event, or 2+ page views). This begins as ‘0’ for all events in a given session then flips to ‘1’ for all events after the session becomes engaged
schema_name STRING NULLABLE The content attribute of the <meta name="govuk:schema-name"> tag
method STRING NULLABLE The method with which the user clicked on the link e.g. ‘primary click’. Populated for navigation and information_click events only
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
content_language STRING NULLABLE The language the content is written in. This prioritises the #content language attribute, but will fall back to the <html> language attribute if not available
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)
link_text STRING NULLABLE The text of the link clicked (sent with navigation and information_click events)
term STRING NULLABLE A keyword that drove a user to the website (utm_term)
link_url STRING NULLABLE The href attribute of a link (sent with navigation and information_click events)
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)
link_domain STRING NULLABLE The destination domain of a link (sent with navigation and information_click events)
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
user_id STRING NULLABLE An ID issued to users that log into the website / associate engagement across devices (not being used on GOV.UK)
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
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
full_link_URL STRING NULLABLE Should no longer be used - the link path parts, concatenated. This field was only correctly populated between February and November 2023. Users seeking this information outside that period should use the link_url field. As of 18th March 2026, this has been set as a NULL value
search_sort STRING NULLABLE Where available this is the sort method e.g. ‘Relevance’
search_term STRING NULLABLE The search term used
search_results INTEGER NULLABLE The number of results returned by the search
ui_text STRING NULLABLE Identifying text for the specific item the user interacted with
section STRING NULLABLE Used to distinguish between multiple sections within an interaction element where the UI/Link text property is not granular enough
action STRING NULLABLE The action the user has taken e.g. ‘opened’
index INTEGER NULLABLE The index of the link that was interacted with e.g. if the third link was clicked the index would be ‘3’
index_total INTEGER NULLABLE The total number of individual links within a feature e.g. if there are five links in total this would be ‘5’
political_status STRING NULLABLE The content attribute of the <meta name="govuk:political-status"> tag
publishing_government STRING NULLABLE The content attribute of the <meta name="govuk:political-status"> tag e.g. ‘historic’. This will only be available on ‘whitehall’ pages
world_locations STRING NULLABLE The content attribute of the <meta name="govuk:analytics:world-locations"> tag
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 This is the app tracking equivalent of session_engaged and is attached to events originating from an app when the criteria for an engaged session have been met.
entrances INTEGER NULLABLE A flag to indicate an entrance, where ‘1’ indicates an entrance
ignore_referrer STRING NULLABLE Value of the ignore_referrer parameter (set to ‘true’ on events where the previous page is on the www.gov.uk domain to prevent self-referrals).
content STRING NULLABLE The ad content/creative that drove the session (captures utm_content), typically used to differentiate between ads or links pointing to the same URL
campaign_id STRING NULLABLE The unique identifier of the marketing campaign (captures utm_id).
index_section INTEGER NULLABLE The index of the section that was interacted with e.g. if the third tab was clicked the index would be ‘3’
index_section_total INTEGER NULLABLE The total number of sections within a feature e.g. if there are five tabs in total this would be ‘5’
ab_test STRING NULLABLE The content attribute of the <meta name="govuk:ab-test"> tag
navigation_list_type STRING NULLABLE The content attribute of the <meta name="govuk:navigation-list-type"> tag
navigation_page_type STRING NULLABLE The content attribute of the <meta name="govuk:navigation-page-type"> tag
percent_scrolled INTEGER NULLABLE The percentage scroll depth the user has reached
step_navs STRING NULLABLE The content attribute of the <meta name="govuk:stepnavs"> tag
is_active_user BOOLEAN NULLABLE Whether the user was active (True) or inactive (False) at any point in the calendar day
video_title STRING NULLABLE The title of the video (only sent with video type events)
video_url STRING NULLABLE The URL of the video (only sent with video type events)
video_duration INTEGER NULLABLE The length of the video in seconds (only sent with video type events)
video_current_time INTEGER NULLABLE The time through the video at the moment the event fired in seconds (only sent with video type events)
video_percent INTEGER NULLABLE The percentage of the video the user had watched at the moment the event fired (only sent with video type events)
cookie_banner STRING NULLABLE ‘True’ when the cookie banner is displayed to the user
devolved_nations_banner STRING NULLABLE Populated when a devolved nations banner is on the page, e.g. ‘England’ when the banner says ‘Applies to England’
intervention STRING NULLABLE ‘True’ when an intervention is displayed to the user
phase_banner STRING NULLABLE Populated when a phase banner is on the page, e.g. ‘beta’ when the beta banner is shown
outbound STRING NULLABLE ‘True’ if a link clicked leads away from www.gov.uk
query_string STRING NULLABLE The query string extracted from the page location
spelling_suggestion STRING NULLABLE The spelling suggestion, if one is shown, on a search results page
outcome STRING NULLABLE The outcome reached at the end of form (only sent with form_complete events)
viewport_size STRING NULLABLE The size of the browser window, minus the scroll bars and toolbars, e.g. ‘1920x1080’. Note: in the flattening process, we only keep string values (a small number of integer and double values that are collected are not flattened)
batch_page_id INTEGER NULLABLE A sequential number assigned to each unique page a user visits during their session. It groups all events that occurred on the exact same page load together. Available from 14th November 2023.
batch_ordering_id INTEGER NULLABLE An increasing number that increments every time GA4 sends a new network request (batch) from that specific page. Available from 14th November 2023.
timestamp INTEGER NULLABLE The Unix timestamp in milliseconds. This is a custom dimension, pushed with every dataLayer event, unlike the default event_timestamp
copy_length INTEGER NULLABLE The number of characters in text copied (copy events only)
govuk_gem_version STRING NULLABLE The version number of the Ruby codebase used in the GOV.UK frontend architecture.
item_list_name STRING NULLABLE The name of the item list - on GOV.UK, this will be the name of a finder (search/search results) page
item_id STRING NULLABLE The URL of the search result item. A maximum of 200 search result items (the first 200) will be sent on longer search results pages
item_name STRING NULLABLE The name of the item displayed to the user in the item list (on GOV.UK, the link text of a search result)
item_list_index STRING NULLABLE The index of the search result item. A maximum of 200 search result items (the first 200) will be sent on longer search results pages
item_content_id STRING NULLABLE The content ID of the search result item
batch_event_index INTEGER NULLABLE The specific sequence number of the event inside a batch based on order of occurrence. Available from 11th July 2024.
global_bar STRING NULLABLE Value is set to true when a user is shown the global bar - e.g. when it reminded users to register to vote
emergency_banner STRING NULLABLE Value is true if the user is served the emergency banner
tool_name STRING NULLABLE The name of the tool (the smart answer or form)
page_tool_name STRING NULLABLE A tool_name value sent with the page_view event
autocomplete_input STRING NULLABLE The user’s input used to generate search autocomplete suggestions
autocomplete_suggestions STRING NULLABLE The last list of suggestions offered by the autocomplete feature
autocomplete_count INTEGER NULLABLE The number of autocomplete suggestions shown
canonical_url STRING NULLABLE The canonical URL of the page, taken from the page header. Note that this is not present on all formats/document types
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
response STRING NULLABLE The user’s response to a form question or error message
discovery_engine_attribution_token STRING NULLABLE A token generated by Google Cloud Vertex AI search.
app_promo_banner STRING NULLABLE A flag that is set to ‘true’ on certain pages on Android devices where a banner promoting the GOV.UK app is displayed.
gtm_container_version INTEGER NULLABLE The version of the Google Tag Manager container that was used to send the event
event_key STRING NULLABLE Combines a deterministically-ordered row number, the stream_id of the event, and the shard date the event was processed in. Used as a unique primary key for the row.

Retention

At present, there is no default table expiry set up for this table, and no agreed data retention period.

This page was last reviewed on 16 September 2026. It needs to be reviewed again on 16 March 2027 by the page owner #insights-and-analytics-alerts .