Custom dimensions and custom metrics are like default dimensions and metrics in your Analytics account, except you create them yourself. You can use them to collect and analyze data that Analytics doesn't automatically track.
Custom dimensions and metrics are set at the property level in an Analytics account. You must have the Editor role on the property to create or edit custom dimensions & metrics.
Creating either a custom dimension or metric is a two step process. First, set up the custom dimension or metric in your property. Then, modify your tracking code. You must complete these steps in order.
In this article:Set up custom dimensions
- Sign in to Google Analytics.
- Click Admin, and navigate to the property to which you want to add custom dimensions.
- In the PROPERTY column, click Custom Definitions > Custom Dimensions.
- Click New Custom Dimension.
- Add a Name.
This can be any string, but use something unique so it’s not confused with any other dimension or metric in your reports. - Select the Scope.
Choose to track at the Hit, Session, User, or Product level. Read more about scope and how custom dimensions are processed in our Developer Guide. - Check the Active box to start collecting data and see the dimension in your reports right away. To create the dimension but have it remain inactive, uncheck the box.
- Click Create.
Set up custom metrics
- Sign in to Google Analytics.
- Click Admin, and navigate to the property to which you want to add custom metrics.
- In the PROPERTY column, click Custom Definitions > Custom Metrics.
- Click the New Custom Metric button.
- Add a Name.
This can be any string, but use something unique so it’s not confused with another dimension or metric in your reports. - From the Formatting Type dropdown, select an Integer, Currency, or Time.
An integer can be any number. The currency type will match the view settings (i.e., USD, Yen, etc.) and should be entered as a decimal number. Specify time in seconds, but it appears ashh:mm:ss
in your reports. - Check the Active box to start collecting data and see the metric in your reports right away. To create the metric but have it remain inactive, uncheck the box.
- Click Create.
Modify your tracking code
After you create custom dimensions or metrics in your property, you must also modify your tracking code. This should be completed by a qualified developer. Follow the instructions in the Developer Guide for your specific environment:
- Website tracking: For Universal Analytics (if using gtag.js)
- Mobile app tracking: For Android and iOS mobile apps
Edit custom dimensions and metrics
Custom dimensions and metrics can’t be deleted once created, but you can return to these settings in your account to manage and edit them. To stop using an existing custom dimension, uncheck the Active box, and click Save.