Date posted

31 Jul 2023

Read Time

Related Articles

Analytics

Using Consent Mode to improve your measurement

Google Analytics 4

What are the new features of Google Analytics 4?

Google Analytics 4

What is scoping in Google Analytics 4?

One of the most common pitfalls we have seen with the rollout of Google Analytics 4 (GA4), is users creating customised explorations that combine metrics and dimensions of different scopes. This leads to confusing and incorrect data being shown in GA4 reports, which in turn could lead to an incorrect marketing decision being made.

The concept of scoping has always existed in Google Analytics, but it has become much more prominent and important in GA4, thanks to the new data model and new data processing logic.

In this article, we explain the different levels of scoping in GA4, and how to ensure you are combining the right dimensions and metrics together within GA4 reporting and explorations.

How is data structured in Google Analytics 4?

Before we go into detail about scoping, it is important to understand the hierarchical structure of data in GA4.

From top to bottom, the data hierarchy is:

  • User
  • Session
  • Event

A user is the highest level in the data hierarchy, and typically represents a browser/device combination that interacts with your website or app. If a user leaves the website and comes back again at a later time through the same browser/device combination, GA4 will still consider them to be the same user. 

Users can be calculated in different ways, depending on the reporting identity that is selected within the admin settings of your configuration.

A session represents the period from when a user visits your website or app to when they leave your website or app. A user can generate multiple sessions if, for example, they are visiting your website or app across different days or multiple times within a day. 

An event represents a distinct user interaction within a session and is the lowest level of the GA4 hierarchy. A page view, or adding a product to cart, would be examples of GA4 events that are collected.

How is data scoped in Google Analytics 4?

GA4 organises data into user, session and event groups, with these groups being known as scopes. 

In GA4 there are three different data scopes to be aware of:

  • User scope
  • Session scope
  • Event scope

User scope

User scoped dimensions show you where your new users are coming from, and this value stays the same as your user returns to your website or app in subsequent visits.

All user scoped dimensions are recognisable in the GA4 interface as they are prefixed with ‘First user’ in the dimension name.

For example, the dimension ‘First user medium’ would record the medium the user found your website from based on their very first visit. This dimension would stay the same for all subsequent visits even if these are via different sources, mediums or campaigns.

The pre-built user acquisition report in the GA4 interface is based on user scoped dimensions.

Session scope

Session scoped dimensions show you where new and returning users are coming from when they start a new session. The value of session scoped dimensions change with every new session started.

All session scoped dimensions are recognisable in the GA4 interface as they are prefixed with ‘Session’ in the dimension name.

For example the dimension ‘Session medium’ would record the medium the user found your website from based on the session they have started. New values are assigned to session scoped dimensions each time users return to your website or app.

The pre-built traffic acquisition report in the GA4 interface is based on session scoped dimensions.

Event scope

Event scoped dimensions help attribute credit for conversion events. 

All event scoped dimensions do not include a ‘first user’ or ‘session’ prefix in their description.

Event scoped dimensions are shown in the model comparison and conversion path pre-built reports in GA4.

Why is data scoping important in Google Analytics 4?

Data scoping is important in GA4, as the dimensions and metrics that you combine, either in pre-built reports or via the explorations module, must belong to the same scope for the data being reported to be meaningful.

Using explorations, it is possible to combine any dimensions and metrics together, even those of different scope.

For example, a GA4 user could build an exploration based on the following dimensions:

  • First user medium (user scoped)
  • Session source (session scoped)
  • Campaign (event scoped)

The output of a report like this could be seen below (this is based on the GA4 demo property).

To the untrained eye, this report may seem correct as the exploration has allowed the user to combine these dimensions together. 

For those who are comfortable working in GA4, there are some stand out errors in this report:

  • Google cpc traffic is being shown with organic campaigns
  • Direct traffic is being shown with a campaign of organic or newsletter
  • Direct traffic is being shown with a source of Google or newsletter

The reason the data is being returned incorrectly is due to the mixed dimension scoping. In our example above we have combined a user scoped dimension (first user medium) with a session scoped dimension (session source) and an event scoped dimension (campaign).

If we were to correct the report to use, for example, session scoped dimensions throughout, the data returned is much more meaningful as shown in the example report below:

In previous versions of Google Analytics, the interface largely prevented you from combining metrics and dimensions of different scopes together. 

With this safety net not in place in GA4, it vastly increases the risk of mistakes leading to the wrong data being analysed, particularly for more novice users of Google Analytics.

To ensure you are analysing the GA4 data correctly remember:

  • All user scoped dimensions are prefixed with ‘first user’
  • All session scoped dimensions are prefixed with ‘session’
  • All event scoped dimensions do not have a prefix
  • Reports should only ever be created with dimensions all belonging to the same scope

How does scoping work alongside attribution in Google Analytics 4?

Hopefully, by reaching this stage of our article, you have a better understanding of what scoping is in GA4 and the importance of scoping in analysing the data correctly.

Scoping and attribution in GA4 are closely linked. For more details on attribution specifically please read our detailed guide to attribution.

The important concept to consider in GA4 is that different scopes use different attribution models.

  • User scoped dimensions use the cross-channel last click attribution model and are unaffected by changes to the attribution model. In other words if your GA4 property was configured to a data-driven model in the attribution settings, the user scoped dimensions would not use this and always revert to the last click model. This setting cannot be modified or changed.
  • Session scoped dimensions also use the cross-channel last click attribution model and are unaffected by changes to the attribution model. In other words if your GA4 property was configured to a data-driven model in the attribution settings, the session scoped dimensions would not use this and always reverts to the last click model. This setting cannot be modified or changed.
  • Event scoped dimensions use the attribution model that you have selected in the attribution settings in GA4. In other words if your GA4 property is configured to a data-driven model in the attribution settings, the event scoped dimensions would use this data-driven model. If you were to change the attribution model in the GoogleA4 attribution settings, this would change the model used on event scoped dimensions.

Therefore, it is possible to run a medium report based on session scoped dimensions and a medium report on event scoped dimensions which each return different conversion volumes per medium due to the differing models.

How is scoping impacted by a change of value in-session?

Another new piece of logic in GA4, which is linked to scoping, is the handling of session scoped dimensions when a change in source, medium or campaign is detected mid session.

Let’s take the example journey whereby a user reaches the RocketMill website via a Google paid search ad. Then, during the same website session, GA4 detects the marketing source has changed to Google organic.

In this type of journey, where a new marketing source is detected mid session, the original marketing source is retained on session scoped dimensions. In other words, the above example would report google / cpc as the session source/medium and not overwrite this with Google organic.

In previous versions of Google Analytics this same journey would have triggered a second session of Google organic, which would lead to inaccurate session metrics and the initial marketing source not getting any credit for a subsequent conversion. This also caused a problem with single page app sites, leading to the widely known rogue referral problem and requiring a complex measurement solution to remedy.

With the new logic in GA4, the rogue referral issue will be consigned to history as the initial marketing source is always retained on session scoped dimensions.

Scoping in Google Analytics 4 explained with an example

As this article has hopefully depicted, there is a lot to consider when it comes to understanding scoping in GA4.

The example journey below will hopefully go some way to understanding and demystifying scoping in GA4.

  • You visit the rocketmill.co.uk website for the first time ever on the 1st of July from clicking a link in the Google paid search listings.
  • You revisit the rocketmill.co.uk website again on the 8th of July, but this time via a Google organic search listing.
  • You revisit the website on the 15th of July by clicking on a utm tracked link in an email newsletter. In the same session you also type the url in the website browser to access the website.

Based on the scenario above, let’s analyse what the first user medium and session medium dimensions would be.

The first user medium would be assigned the value of cpc, on the basis that the first ever visit to the website on the 1st of July was from cpc.

The session medium would be assigned as follows, based on the three distinct sessions outlined above.

Session medium
Session 1 1st July cpc
Session 2 8th July organic
Session 3 15th July email

For session 3 in the above example, this is email as opposed to direct. This is because the logic built into GA4 is that, when a new source medium or campaign is detected mid session, the original medium (i.e. in this example email) is retained.

In summary

Whilst scoping has always been a feature in Google Analytics, it was something that previously didn’t need a huge level of understanding as the customised reporting available in Universal Analytics and preceding versions would not permit the combinations of dimensions and metrics across different scopes.

With the new data model in GA4, and the explorations feature allowing the combination of dimensions and metrics across different scopes, now is the time to properly understand the principles of scoping and the impact this has on your data.

Failing to properly understand the impact of scoping will lead to invalid or nonsensical reports being produced in GA4, potentially leading to wrong marketing decisions being made. From our experience so far, the mixing of dimensions across different scopes has been the single most common mistake made across users adopting GA4.

The key takeaways to consider about scoping in GA4 are listed below:

  • There are three different scope types in GA4, namely user, session and event.
  • User scoped dimensions are prefixed with ‘First user’ (e.g. first user medium) and use the last click attribution model.
  • Session scoped dimensions are prefixed with ‘Session’ (e.g. session medium) and use the last click attribution model.
  • Event scoped dimensions do not have a prefix (e.g. medium) and use the attribution model that is selected in the attribution settings within your GA4 property configuration.
  • Dimensions across different scopes should not be mixed in a report or exploration in GA4, as it will lead to nonsensical data. Unlike previous versions of Google Analytics, GA4 won’t block or inhibit invalid dimension/metric combinations from being analysed.
  • If the marketing source, medium or campaign changes mid session, a new session is not initiated in GA4, with the original marketing source, medium and campaign retained. This is particularly useful where a site is based on a single page app as it means there are no longer attribution problems posed by the rogue referral issue.

If you have any further questions on scoping in GA4, or around GA4 in general please contact us.