What is the difference between Custom Dimensions and Custom Variables?
Custom Dimensions are similar to Custom Variables but they provide several advantages:
- Each dimension has its own menu item under either « Visitors » or « Behavior » making them first class citizen reports
- A single Custom Dimension report can be widgetized whereas it is only possible to widgetize all Custom Variables reports combined
- More metrics are available for Custom Dimensions in scope « Action » (Unique actions, Exit rate, Bounce rate, Average time on dimension, Average generation time) and the row actions Segmented Visitor Log, Overlay and Transitions can be used
- Custom Dimensions are easier to segment as the segment name will be the name of your Custom Dimension in the UI
- Custom Dimensions are more efficient as they need less storage and reports can be generated faster
- Custom Dimensions are easier to track as only the Custom Dimension ID and Value need to be set in the tracker whereas for Custom variables the Name, Scope, Index and Value need to be set during tracking.
- Custom Dimension values in scope Action can be tracked automatically by extracting the value from the tracked URL or Page Title
- The name of a Custom Dimension can be changed at any time
- Values of Custom Dimensions are limited to 255 characters whereas Custom Variables are limited to 200
However, there is also a limitation. Unlike Custom Variables you cannot use the same slot/index for many different names or use cases. While for both Custom Variables and Custom Dimensions 5 slots in scope Action and 5 slots in scope Visit are available, you cannot use a specific slot of a Custom Dimension for something else. Once you have created a new Custom Dimension you can only deactivate it. Deleting a dimension and creating a new one is not possible. However, if you ever run out of available Custom Dimension slots you can make more available at any time. This just might take a while as it requires schema changes in the database.
In general we recommend users to use Custom Dimensions as we will deprecate Custom Variables at some point. With Matomo (Piwik) 3.0 Custom Dimensions will be most likely installed by default.