Custom dimensions let you group your data in your own way. You write a formula that derives new values from existing dimensions, for example the domain from a URL or a "Meta / Non-Meta" label. You can create one from a dashboard widget, in the Custom fields tab in Settings, or while building a custom report. After you save a custom dimension, everyone in your account can use it.
What are custom dimensions?
A custom dimension is a field you define with a formula that uses existing dimensions. For example, you can extract part of a campaign name, convert text to lowercase for grouping, or label rows based on a condition. After you save it, you can choose it like any standard dimension to break down reports and dashboard widgets.
Create a custom dimension from a dashboard
- Open a dashboard.
- If you haven't already, set the client, campaigns and dates. Click the pencil beside Global Filters, make your selections, then click Apply to all tabs and confirm.
- Click the widget you want to use. If the dashboard has no widgets, add one first with Add New Widget.
- In the settings panel on the right, open the Data tab and click the + icon in the Dimensions section.
- Click Custom Dimensions, then click Add Custom Dimensions.
- In the dialog that opens, enter a name for the custom dimension.
- Build your formula using the Available Functions and Available Dimensions lists. Click a dimension in Available Dimensions to insert it into the formula.
- Click Submit. A confirmation message, Custom dimension saved successfully, appears.
Important: Always insert dimensions from the Available Dimensions list. Don't type their names. If you type a dimension name in quotes, for example IF("Gender" = "Male", ...), the formula saves but treats the name as fixed text, so every row shows the same value. If you type a name without quotes, the formula is invalid and can't be saved. Fixed text values, such as "Male", should still be typed in quotes.
Other places to create a custom dimension
- Settings: Open the Custom fields tab, open the custom dimensions sub-tab, then click Create.
- Custom reports: In the Add Dimension picker, choose the custom dimension option.
Supported functions and syntax
You can use text, date, logical and regular expression functions in a custom dimension formula. In the tables below, the Example column uses dimensions inserted from the list, and the Example with fixed values column shows the same function with typed values.
Note: There's no OR or AND function. To check more than one condition, nest IF functions. For example: IF(CONTAINS_TEXT(Platform_Campaign, 'Brand A'), 'Brand A', IF(CONTAINS_TEXT(Label, 'Brand A'), 'Brand A', 'Other')).
Text functions
| Function | Summary | Example | Example with fixed values |
|---|---|---|---|
CONCAT(X, Y[, Z, ...]) |
Joins two or more fields or expressions into one piece of text. | CONCAT(Advertiser, ' - ', Campaign) |
CONCAT('Nike', ' - ', 'Summer Campaign') |
CONTAINS_TEXT(text, substring) |
Returns TRUE if the text contains the specified substring, and FALSE if it doesn't. | CONTAINS_TEXT(Ad_Format, 'Video') |
CONTAINS_TEXT('Video Banner', 'Video') |
LOWER(text) |
Converts text to lowercase. | LOWER(Device_GA4) |
LOWER('MOBILE') |
UPPER(text) |
Converts text to uppercase. | UPPER(Channel) |
UPPER('display') |
TRIM(text) |
Removes spaces from the start and end of text. | TRIM(Creative) |
TRIM(' Summer Banner ') |
SPLIT(text, delimiter[, position]) |
Splits text at a delimiter and returns the specified part. | SPLIT(Platform_Line_Item, '_', 2) |
SPLIT('Campaign_Prospecting_Display', '_', 2) |
Date functions
| Function | Summary | Example | Example with fixed values |
|---|---|---|---|
YEAR(date) |
Returns the year of a date as a number. | YEAR(Placement_Start_Date) |
YEAR('2025-03-15') |
TODAY() |
Returns the current date. | TODAY() |
TODAY() |
DATE_DIFF(start_date, end_date, date_part) |
Returns the difference between two dates in the specified unit. | DATE_DIFF(Placement_Start_Date, Placement_End_Date, 'day') |
DATE_DIFF('2025-03-01', '2025-03-31', 'day') |
Logical functions
| Function | Summary | Example | Example with fixed values |
|---|---|---|---|
IF(condition, value_if_true, value_if_false) |
Returns one value if a condition is true and another if it's false. | IF(Buying_Platform == 'Facebook Business', 'Meta', 'Non-Meta') |
IF('Facebook Business' == 'Facebook Business', 'Meta', 'Non-Meta') |
IFNULL(expression, value_if_null) |
Returns the first expression if it has a value, and the second expression if it's empty. | IFNULL(Referring_Agency, 'Direct Client') |
IFNULL(Referring_Agency, 'Direct Client') |
Regular expression functions
| Function | Summary | Example | Example with fixed values |
|---|---|---|---|
REGEXP_EXTRACT(text, pattern[, index]) |
Extracts the part of the text that matches a regular expression pattern. | REGEXP_EXTRACT(Phone, '\\d{3}') |
REGEXP_EXTRACT('Phone: 123-456-7890', '\\d{3}') |
REGEXP_REPLACE(text, pattern, replacement) |
Replaces the parts of the text that match a regular expression pattern with replacement text. | REGEXP_REPLACE(Ad_Server_Campaign, ' 2025', ' Updated') |
REGEXP_REPLACE('Summer Sale 2025', ' 2025', ' Updated') |
Other supported functions
The formula editor also supports SUBSTRING, LEN, WEEK_DAY and DATE_ADD.
Limitations
- Not available as filters: You can't use custom dimensions as dashboard, tab or widget filters. Use them to group or break down data instead.
- Not available in Tracker: You can't add custom dimensions as Tracker columns. Use them in custom reports and dashboards instead.
-
A dash means there's no value: A dash (–) in a custom dimension column means the formula returned nothing for that row. It isn't an error. This usually happens when an
IFhas no value for the false case, or when a field in the formula has no data for that row. If every row shows the same value or a dash, check that the fields were inserted from the list and not typed.