How to create custom dimensions and metrics on Google Analytics
Custom dimensions and metrics in Google Analytics 4 allow you to track specific data points unique to your business needs. You can create them through the Admin section by defining custom dimensions for qualitative data and custom metrics for quantitative measurements.
Prerequisites
- Active Google Analytics 4 (GA4) property
- Admin access to the Google Analytics account
- Basic understanding of data tracking concepts
- Website with Google Analytics tracking code installed
Step-by-Step Instructions
Access Google Analytics Admin Panel
Navigate to Custom Definitions
Create a Custom Dimension
- Dimension name: Enter a descriptive name (e.g., "User Type" or "Content Category")
- Description: Add a clear description of what this dimension tracks
- Event parameter: Enter the parameter name that matches your tracking code
- Scope: Choose between Event, User, or Item scope based on your tracking needs
Create a Custom Metric
- Metric name: Enter a descriptive name (e.g., "Video Watch Time" or "Download Count")
- Description: Describe what this metric measures
- Event parameter: Enter the parameter name from your tracking implementation
- Unit of measurement: Select from Standard, Currency, Distance, or Time
Implement Tracking Code
gtag('event', 'page_view', {
'custom_parameter_name': 'your_value'
});For custom metrics, send numerical values:gtag('event', 'video_complete', {
'watch_duration': 120
});Replace the parameter names with those you defined in GA4.Verify Data Collection
Create Custom Reports
Common Issues & Troubleshooting
Custom dimension showing (not set) values
Check that your tracking code parameter name exactly matches the one defined in GA4. Verify the tracking code is firing correctly and sending data for all relevant events.
Custom metric not appearing in reports
Ensure you're sending numerical values for custom metrics, not text. Verify the event parameter name matches exactly, and wait 24-48 hours for data processing.
Data appears inconsistent or incomplete
Check your event scope settings - User scope applies to all events for that user, while Event scope only applies to specific events. Review your tracking implementation for consistency.
Cannot create more custom dimensions
GA4 has a limit of 50 custom dimensions per property. Review existing custom dimensions and delete unused ones, or consider combining similar dimensions into one with multiple values.