Custom Dimension and Metric Scoping

Subscribe to our monthly newsletter to get the latest updates in your inbox

Are you limiting your Google Analytics data without even knowing it? Are you afraid to apply deeper granularity to your current implementation for fear of data-breaks? Fear not! Why should you be interested in Custom Dimensions and Custom Metrics? Well, without this added layer of useful, business-specific dimensionality you're limiting your data collection to what Google Analytics provides out-of-the-box. Dimensionality with customization can help you explain complicated questions or seemingly strange behavior about your users and your site’s behavior. Understanding your business needs will help reveal important considerations when creating these custom dimensions and custom metrics. In this post, we’ll walk you through the basics and differences of Custom Dimensions (CDs) and Custom Metrics (CMs), then we'll move into reviewing some of the pitfalls with Google Analytics reporting with different scopes of CDs and CMs. First, let’s start with the basics—Dimensions vs Metrics: what’s the difference? Dimensions are qualitative attributes of your website—they help you ‘describe’ the data. Metrics are quantitative measures of dimensions—measuring the data you’ve described. These Dimensions and Metrics become ‘Custom’ when you apply your company's unique naming conventions to track the most important KPIs. Interested in learning which CDs and CMs are natively built into your GTM utility? Check out our post on what Analytics Pros identifies as ‘Utility Custom Dimensions’ that might be helpful when considering your own CD/CM build out. Or you might be interested in what Google has to say—check out their Dimension and Metrics Explorer here . Now that we’ve identified what the differences are between a Dimension, Metric, and the Google Analytics out-of-box CDs and CMs we can now move into the bulk of this post: Scoping. Scoping is important because it's the user-set characteristic of each dimension and metric and each can only have one scope. Scoping allows us to sum and aggregate metrics according to reporting needs. If you inaccurately set the scope, the ‘area or subject matter in question’ (or scope) will incorrectly send to Google Analytics and, therefore, collect inaccurate data. We’ll go through an example to walk through the four different scoping types: Hit, User, Session, and Product. But first, let’s review the four types.  

User Scope

When two values with user-scoped custom dimensions are set within the same session, the last value set gets precedence for the current session, and is applied to future sessions for that user. Data is associated with all hits within the given session and future sessions for the given user. Users are based on a cookie, tied to the user’s browser. The user is the highest level of data collected—connecting previous and future web behavior. Once the user’s browser receives a ‘cookie’, it stays there for 2 years unless the user clears their cookies. You can learn more about cookies and how Google utilizes them to collect data here .  

User has a session with three hits (H1, H2, H3). No CD values are set.

 

The same user returns and has another session, with three more hits. CD1 value is set to A on H3. CD1 value is then applied to all hits in session.

 

User returns for a third session with three more hits. CD1's user-level scope causes value A to be applied to all hits in session 3.

   

Session Scope

When two values with session scope are set at the same index in a session, the last value set gets precedence is applied to all hits in that session. Data is associated with all hits within the given session.  

User sends a hit (H1) with no CD value.

 

In the same session, user sends a second hit (H2) with CD1 value set to A. Session scope causes value A to also be applied to H1.

 

User sends a third hit (H3). Although no CD1 value is sent with H3, session scope causes value A to be automatically applied to H3.

 

User sends a fourth hit (H4) with a new CD1 value B. Session-scope applies value B to all the hits in the session, overwriting value A in the previous hits.

   

Hit Scope

When a custom dimension has hit-level scope, the value is only applied to the hit with which the value was set. Data is associated with ONLY the hit that is comes in with.  

User sends two hits (H1, H2). H2 has a CD1 value of A. That value is only applied to H2.

 

User sends a third hit (H3). H3 has no CD value.

 

User sends a fourth hit (H4). H4 has a CD1 value of B. That value is only applied to H4.

   

Product Scope

When a single hit contains multiple products, the dimensions are associated only with the product object they are sent with. Data is associated with the single product in the hit.  

If the user views a Product Listing Page, then each product will contain a unique value for your specified Product scoped custom dimension.

In this case, Product Listing Page – H1 sends CD1 = A

  Images via Google .   Want to learn even more about Scoping? Check our post on Scoping here . When reporting on any dimension or metric data, custom or not, GA will let you make invalid dimension-metric combinations in reporting, which is crucial to keep in mind while analyzing because you can make easy analyzing mistakes. Several other important questions to consider: What am I trying to analyze and which data components do I need to create this report accurately? Do these combinations make sense with regard to the way the GA collects data and the way I’ve scoped my custom dimension/metrics? Below are examples of how you analyze data in different reports in Google Analytics with varying scopes in your custom dimensions.   Report : Behavior >  Top Events Scope : Hit   Secondary Dimension: CD: Form Field Scope: Hit This report makes sense because we have a valid scope combination.     Report : Acquisition >  Source/Medium Scope : Session/User   Secondary Dimension: CD: Business Line Scope: Session This report makes sense because we have a valid scope combination.     Report: Acquisition >  Source/Medium Scope : Session/User   Secondary Dimension: CD : Buyer Type Scope : User     Report: Conversions >  Ecommerce >  Product Performance Scope : Product   Secondary Dimension: CD : Product Color Scope: Product This report makes sense because we have a valid scope combination.   If you tried to use a Product Scoped CD with the Source/Medium report, you are mixing scopes and will get a report without sessions.   If you need help with setting up or determining the scope of your dimensions and metrics, contact us at gethelp@analyticspros.com!