Blending UA and GA4 in Looker Studio

Here are the basic steps for blending Universal Analytics and GA4 data into the same chart in Looker Studio. Most of this is just knowing how to use data blends, but there are a few parts specific to the UA/GA4 use case that may save you some time.

Note of caution: be careful when combining metrics that UA and GA4 calculate differently (Users, sessions, bounce rate, etc). It’ll work, but your visualization may tell a misleading story. Hit-based metrics like pageviews and events should be more consistent.

Overview

We’ll join the two data sources on a shared dimension (eg, a date dimension), add date filters in the data blend to specify the cut-off date between UA and GA4, and use calculated fields to merge the data into single dimensions and metrics for our chart.

In this example we’re going to chart monthly pageviews across the UA/GA4 cut-off.

The steps

First, create two tables, one for the Universal Analytics data source, one for GA4. I’m using Year month but you can use any date field where GA3 and GA4 have the same values. See the note below about an extra required step if you’re using the Date field.

Screenshot of a Universal Analytics table and a GA4 table in Looker Studio.

Now we’ll create the blend. Select the two tables, right click > Blend data.

Next, change the join configuration to Full outer, so we get all of the rows from each table, and use your date field for the join condition.

Screenshot of the blend configuration for blending UA and GA4 tables.

Now we need to define the cut-off date between UA and GA4 so the data doesn’t overlap.

The first time I did this I used the Date range option within the blend configuration to specify the two date ranges. This works fine for a chart with a fixed date range, but it won’t be responsive to the date range control.

A better approach is to define your date ranges with a filter, which will allow the date range in your chart to inherit from the date range control or page settings.

Screenshot of the date filters in the blend configuration to specify the cut-off.

Note: If you’re using the Date field to join your tables you need to first create a custom Date field in your GA4 data source in order for the filter to work. (Thanks to Kuura Tuononen on Measure Slack for figuring this out.)

The field doesn’t do anything special, it’s just a wrapper around the default Date field.

And then you’ll use this custom date field as the join field in your blend.

Screenshot of the custom date field in the GA4 data source.

Back to our original example, when we save the blend we’ll get a new table but it’s not doing what we want yet. Each data source has its own date and page view columns.

Screenshot of the new data blend.

The last step is to create calculated fields in the chart for the date dimension and pageviews metric, using the COALESCE function, which will merge the fields into one date dimension and one pageview metric.

Screenshot of using caclulated fields to merge the date and pageview fields.

The result

Now we have our UA and GA4 data together in one chart.

Screenshot of the final data blend as a table.

Screenshot of the final data blend as a timeseries chart.

Thoughts? Get in touch on Twitter, email, or Measure Slack.