Sub topic 7
High-cardinality dimensions
This chapter assumes you can read a GA4 report and an Exploration. It also assumes you know the difference between dimensions and metrics, and between events, users, and sessions. The SQL example needs basic SQL. Earlier chapters covered data thresholds and sampling. This chapter covers the third cause of altered numbers, which is the number of distinct values a dimension can take. The next chapter covers the (other) row in detail.
What cardinality means
Cardinality is the number of distinct values in a dimension. Some dimensions have few values, and others have almost as many values as there are events.
| Dimension | Typical distinct values | Cardinality |
|---|---|---|
| Device category | 3 (desktop, mobile, tablet) | Low |
| Country | Up to about 250 | Low |
| Default channel group | About 15 | Low |
| Page path | Hundreds to thousands | Medium |
| Page path plus query string | Often tens of thousands | High |
| Page location (full URL) | Often tens of thousands or more | High |
| Transaction ID | One per purchase | Very high |
| User ID, client ID, session ID | One per user or session | Very high |
| Custom dimension holding a timestamp, search term, or free text | Often close to one per event | Very high |
Cardinality is not a property of the data alone. It depends on what your site and tagging put into each field. A page path is moderate on a site with clean URLs. The same dimension is high on a site that appends a tracking token to every URL.
Why GA4 cares
GA4 does not build every report by scanning raw events when you open it. Reports are served from processed, aggregated tables that Google builds ahead of time. Each table row is a unique combination of dimension values for one day. A table with one dimension and 40 distinct values has 40 rows per day. A table with two dimensions can have up to the product of the two counts.
Google limits how many unique rows it keeps per day for these tables. The exact limits differ between standard and 360 properties and between report types, and Google changes them. Check the current "(other) row" and "Data-collection limits" Help pages for the numbers that apply to you. The mechanism is the same everywhere. When a day produces more unique rows than the limit allows, GA4 keeps the rows with the most activity. It merges the remaining low-activity rows into a single row labelled (other).
The limit applies per day. A report for one year does not hit it any more easily than a report for one day, but every day in the range can lose its own tail of rows. A busy day can overflow while a quiet day does not. This produces a pattern that surprises people: the same page appears by name on some days and disappears into (other) on others.
How dimensions multiply
Adding a second dimension multiplies the row count, so it can push a report over the limit even when each dimension is moderate on its own.
Consider one day on a store site:
- 4,000 distinct page paths
- 30 distinct source and medium pairs
- 3 device categories
A table of page path alone has at most 4,000 rows. Add source and medium and the table can reach 120,000 rows. Add device category and it can reach 360,000. Real data does not fill every combination, because most pages are not visited from every source on every device. In practice the count lands well below the product, but it still grows quickly. This is why a report that looked fine with one dimension can suddenly show (other) after you add a second.
Common sources of high cardinality
- URLs with query strings. Page location and "Page path + query string" include everything after the
?. Campaign parameters, session tokens, search terms, and filter selections each create a new value. GA4 does strip some parameters by default, and you can configure more. Anything you have not configured stays in the value. - Identifiers used as dimensions. Registering
transaction_id, a user ID, or an order number as a custom dimension gives you one value per entity. - Free-text custom parameters. Internal search terms, form field contents, error messages, and timestamps vary almost every time.
- Event name sprawl. If events are named dynamically, for example
click_button_Blue_XL_US, the event name dimension becomes high cardinality. This also runs into separate GA4 limits on distinct event names. - Long date-like or numeric values. A parameter that stores a millisecond timestamp has a new value on almost every event.
Cardinality is different from data thresholds and sampling
The three mechanisms look similar in a report, but they work differently.
| Mechanism | What happens to the data | Trigger |
|---|---|---|
| Data thresholds | Rows are withheld | Small counts, and user-level data such as demographics |
| Sampling | Numbers are estimates | Large event volume in Explorations |
| High cardinality | Rows are merged into (other) | Too many unique rows per day |
High cardinality does not remove events. It changes how rows are grouped. The total in the (other) row plus the named rows still equals the real total for additive metrics such as event count. Non-additive metrics such as active users do not behave this way, because a user can appear in several rows. Summing the rows of a user-based metric over-counts, and the (other) row cannot be split back into named rows.
Measuring cardinality yourself
If the BigQuery export is on, you can measure the cardinality of a candidate dimension before you build a report on it. The query below counts distinct values per day for the page location, and compares that with the cleaned page path that results from removing the query string and fragment. Replace the project, dataset, and dates with your own.
WITH pages AS (
SELECT
PARSE_DATE('%Y%m%d', event_date) AS day,
(SELECT value.string_value
FROM UNNEST(event_params)
WHERE key = 'page_location') AS page_location
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260101' AND '20260131'
AND event_name = 'page_view'
)
SELECT
day,
COUNT(DISTINCT page_location) AS distinct_urls,
COUNT(DISTINCT REGEXP_EXTRACT(page_location, r'^[^?#]+')) AS distinct_urls_without_query
FROM pages
GROUP BY day
ORDER BY day;If distinct_urls is many times larger than distinct_urls_without_query, query strings are inflating your cardinality. The gap tells you how much you would gain by removing them. You can then look for the parameters responsible. To rank them, extract the part after ? and count the values per parameter name.
Treat the result as a guide, not as a prediction of exactly where GA4 will cut off. GA4's own limits count unique row combinations in the specific report, not distinct values of one field, so a single-dimension count is a lower bound for any report that adds more dimensions.
Recognizing the effect in the interface
A cardinality problem usually shows up in one of these ways:
- A row labelled
(other)appears in a table, often among the top rows by metric. - The same dimension value is present for some dates and missing for others.
- A report that was clean for a short range shows
(other)over a longer range, or after you add a dimension. - The Explorations table and the standard report disagree for the same dimension and range.
An (other) row can also come from a dimension value that is literally the string "(other)". For example, the source dimension can legitimately be (other) for some traffic. When you see the label, check which dimension is responsible before concluding that rows were merged. The next chapter covers how to tell these cases apart.
Reducing cardinality
Most fixes work on the same lever, which is to reduce the number of unique rows per day.
- Use a lower-cardinality dimension. Prefer page path over page location, and page title or a content group over page path, when the question allows it.
- Remove noise from values. Exclude query parameters in the data stream settings where the option exists, and remove tokens at the source, in your tagging or URL scheme.
- Group values at collection time. Send
product_categoryinstead ofproduct_sku, orsearch_term_length_bucketinstead of the raw term, when the grouped value answers the question. - Drop dimensions you do not need. Each extra dimension multiplies rows. Remove one and check whether the
(other)row disappears. - Filter the report. Filtering to one section of the site or one segment reduces the rows that compete for space on each day. Do this in the report itself, not by limiting the date range, since the limit applies to each day separately.
- Do not register identifiers as dimensions. Keep user IDs and transaction IDs for BigQuery, where there is no row limit.
- Move the question to BigQuery. The export holds event-level data. You can group by any combination of values, and no rows are merged.
Other surfaces
Standard reports, Explorations, and the Data API each have their own handling of high-cardinality data. Explorations are more often able to show full rows because they query event-level data, but they can still produce an (other) row when a result is too large. The Data API reports the loss in its response metadata, and a later chapter shows how to read that flag. BigQuery has no row limit of this kind, which is why it is the reference when numbers in the interface look wrong.
Exercise
A table with the dimensions Page location and Source / medium shows an (other) row for a 30-day range. Explain why adding Source / medium can cause this when Page location alone did not, and name two changes that would reduce the problem.
Show answer
Each row is a unique combination of dimension values per day. Adding Source / medium multiplies the possible combinations of pages and sources, so the daily unique row count can pass the limit even though Page location alone did not. GA4 keeps the highest-activity rows and merges the rest into (other). Two fixes: use Page path instead of Page location, which removes query strings, or remove Source / medium and use Default channel group, which has far fewer values. Filtering the report to one section of the site, or moving the query to BigQuery, also works.
Exercise
The BigQuery query in this chapter returns distincturls of 90,000 and distincturlswithoutquery of 2,500 for one day. What does that tell you, and what is the next step?
Show answer
Query strings add most of the distinct values: roughly 87,500 of the 90,000 are variations of about 2,500 base URLs. The next step is to find which query parameters create the variation, for example by extracting the part after the ? and counting values per parameter name. Then exclude those parameters in the data stream settings or remove them at the source, and use Page path in reports. The count is a lower bound for a report with more dimensions, so confirm the result in the report afterwards.
Exercise
A colleague says the (other) row only loses events, so the report's total is too low. Is that correct?
Show answer
No. Cardinality merges rows into (other) and keeps their events there, so additive metrics such as event count still add up to the real total. The named rows are incomplete, not the total. For user-based metrics such as active users, summing rows over-counts because a user can appear in several rows, and the users in (other) cannot be assigned back to named rows.