Understanding custom dimension scope and structure
Custom Dimensions within Matomo can be associated with two different scopes:
- Visit Dimensions – Associated with a visitor to your site for the length of their visit.
- Action Dimensions – Associated with each and every action taken on your site, no matter who performs the action, or how many times.
Visit Scoped Custom Dimensions
Custom Dimensions with a Visit scope are used to link metadata about a user with Visitors analytics data. Following on from the initial examples, this covers dimensions such as:
- User Type
- Company
- Gender
It’s important to note that Visit scoped dimensions can only hold one value. If a User Type is updated during a visit, the most recent value will always be reflected. For example, if a visitor starts as a Guest, then becomes a Customer, only the final status of Customer would be stored against the visit.
Action Scoped Custom Dimensions
Custom Dimensions with the Action scope enhance your tracking by adding context to all website interactions such as pageviews, outlinks, downloads and events. Action scoped data is likely to include things such as:
- Page Author
- Page Age
- Page Location
- Page Type
- Page Language
- Split Test Variation – Although, we recommend you use an A/B testing tool for this.
Data Structure
Custom Dimensions consist of the following primary building blocks:
- ID – This is a system-assigned numeric ID used to differentiate between dimensions.
- Name – This is a user-friendly label for the dimension shown within your reports.
- Scope – Whether the dimension applies to a Visit or Action
- Status – Whether the dimension is activated or not.
- Values – The actual data stored against the dimension for each stored interaction.