Migrating things from UA to GA4
This page is a work in progress.
Reports and dashboards using Universal Analytics (UA) data will have to be migrated to use Google Analytics 4 (GA4) data if they are to remain functional.
Migrating a Looker Studio report
There are a number of ways this can be done, the first one being by using the default (or ‘native’) GA4 > Looker Studio connection. Alternatively, GA4 data from BigQuery can be used in Looker Studio from either our pre-built shared connections, or by using a custom query.
Migrating a Looker Studio report - default connection
High level steps:
- Make a copy of the report being migrated, or export a PDF/other copy so that you have a reference. If you want to maintain the report URL you will want to edit the original to use GA4 data, but it is helpful to have a copy or reference so that you know what all the tables contained and what filters were used
- In the report you want to migrate to GA4, add the GA4 data source. This can be done using the default Google Analytics connector (in the menu, following ‘Resource’ > ‘Manage added data sources’ > ‘Add a data source’ > ‘Google Analytics’), and selecting the correct GA account and GA4 dataset
- Switch your tables and visualisations to use the newly added GA4 data source. When you do this your tables will break or start to show information very different to what they originally displayed
- Go through each table and chart and switch the dimensions and metrics to the correct GA4 equivalent. In some cases these will be very similar (have the same name etc) to the previous UA dimensions and metrics, but in some cases you will need to find an alternative metric as not all the same dimensions and metrics exist in UA and GA4. You may also need to familiarise yourself with the GOV.UK GA4 data structure if you are interested in specific events
- Test and check the report. Comparing it to the UA version can be interesting but in many places the numbers will be quite different, so you should not expect the GA4 and UA versions to look the same in all places
Migrating a Looker Studio report - BigQuery connection
If you were previously using UA data in Looker Studio, and had this connected via tables in BigQuery, then this can be swapped over using the BigQuery > Looker Studio connection. If you are GDS staff, please use the shared connections already set up, as listed here
Where possible, please use the flattened datasets. These will be more efficient for Looker Studio to query when users are interacting with your reports. The GOV.UK GA4 Production BigQuery flattened shared connection also uses our partitioned tables which is our preferred, and now default, data source.
Alternatively, it is possible to connect to GOV.UK GA4 data in BigQuery via a custom query. We have guidance on how to do this here
UA to GA4 dimension and metric exchange
An incomplete list of some commonly used dimensions and metrics in UA and what their GA4 equivalent might be:
Field in UA | Field in GA4 | Notes |
---|---|---|
Previous page path | Page referrer | These two dimensions are technically quite different |
Event Category | - | Event Category no longer exists |
Event Action | - | Event Action no longer exists |
Event Label | - | Event Label no longer exists |
Pageviews | Views | The ‘Views’ metric in GA4 would also cover screen views if we were collecting app data into the property. You can also get the total page views number if you use the ‘Event count’ metric and filter to the event name ‘page_view’ |
Unique pageviews | Sessions, when used against a page dimension | There is no ‘Unique pageviews’ metric in GA4. The closest equivalent if you are trying to get a figure for the number of sessions in which a user viewed a page is ‘Sessions’ |
Total Events | Event count | |
Unique Events | - | |
Sessions | Sessions | The total number of sessions in GA4 will be equivalent (though different) to the total number of sessions in UA |
Users | Total users | In GA4 this is the total number of unique users who logged an event |
Time on Page | User engagement | These two metrics are collected/calculated in quite different ways |
Goal | Key event | For actions considered a ‘conversion’ you would now create a key event, rather than a goal |
Bounce rate | Bounce rate | This is now calculated as the percentage of sessions that were not engaged sessions in GA4 |