GA4 Page Path Regex — Why Yours Returns No Data (and 15+ That Work)
A practical Google Analytics 4 page path regex check: how GA4 actually evaluates your pattern, the five mistakes that produce empty reports, and 15+ ga4 page path regex examples you can copy, test in the free regex tester, then paste into any GA4 filter or exploration.
The one rule to remember: GA4 regex is a full match. Your pattern must cover the entire value. /blog/ does not match /blog/post-1 — that single misunderstanding causes most "GA4 regex not working" reports.
How GA4 evaluates a page path regex
Before the examples, four things decide whether your pattern matches:
- Full-match semantics. The regex must match the whole dimension value from start to end. There is no implicit "contains". Anchors like
^and$are technically allowed but usually redundant. - The dimension matters.
page_pathholds only the path (/blog/post-1) — no domain, no?query.page_locationholds the full URL. A pattern that includeshttps://will never matchpage_path. - Case-sensitive.
/Blog/≠/blog/in GA4 filters. - RE2 engine. No lookahead
(?=…), no lookbehind(?<=…), no backreferences\1. Those fail silently.
GA4 page path regex examples (copy-paste ready)
Every row links to the tester with the pattern and a sample value pre-loaded, so you can see it match before you use it in GA4.
Sections & directories
| You want | Regex | |
|---|---|---|
Everything under /blog/ | /blog/.* | Try in tester → |
| The blog index and its posts | (/blog|/blog/.*) | Try in tester → |
Starts with /category/ | /category/.* | Try in tester → |
Language prefix /en/ or /de/ | /(en|de)/.* | Try in tester → |
| Home page exactly | / | Try in tester → |
URL shape & depth
| You want | Regex | |
|---|---|---|
Product detail /products/<slug> | /products/[^/]+ | Try in tester → |
| Product listing only | /products | Try in tester → |
| Exactly two path segments | /[^/]+/[^/]+ | Try in tester → |
| Three or more segments (deep pages) | (/[^/]+){3}.* | Try in tester → |
| Any page with a query string* | .*\?.* | Try in tester → |
| URLs tagged with utm_source* | .*[?&]utm_source=.* | Try in tester → |
* These two match page_location (full URL) — page_path never contains a query string.
Files, extensions & keywords
| You want | Regex | |
|---|---|---|
Paths ending in .pdf | .*\.pdf | Try in tester → |
Any .html page | .*\.html | Try in tester → |
| Path contains "checkout" | .*checkout.* | Try in tester → |
| Search results pages | (/search|/search/.*) | Try in tester → |
| Any casing of "/pricing" | (?:/pricing|/Pricing|/PRICING) | Try in tester → |
Why your page path regex returns no data
- You wrote "contains" logic.
/blog/→ zero rows for/blog/post-1. Fix:/blog/.*or.*blog.*. - You included the domain.
https://example.com/blognever matchespage_path. Strip it, or switch the filter topage_location. - You looked for the query string in
page_path. It isn't there — usepage_location. - Trailing-slash variance.
/pricingand/pricing/are different values. Cover both:(/pricing|/pricing/). - Case differences.
/Blog/won't match/blog/. - You used an assertion.
(?!…),(?<=…),\1— RE2 rejects them silently. For "match X but not Y", add a second exclude filter in GA4 instead of a negative lookahead.
FAQ
Why does my GA4 page path regex return no data?
Nine times out of ten it's full-match: the pattern must cover the entire value. /blog/ only matches the exact string /blog/. Wrap it — /blog/.* — and the rows come back.
Does GA4 page_path include the query string?
No. page_path is path-only (no domain, no query). To match parameters like utm_source, filter on page_location instead.
Does GA4 regex support lookahead?
No — GA4 uses RE2. Lookahead, lookbehind and backreferences are unsupported. Use character classes, alternation, or a second include/exclude filter.
Is GA4 regex case-sensitive?
Yes. /Blog/ does not match /blog/. Use alternation like (?:[Bb]log) when casing varies.
More patterns in the GA4 regex cheat sheet — page path, event names, traffic sources and page titles in one list.