Advertisement

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:

  1. 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.
  2. The dimension matters. page_path holds only the path (/blog/post-1) — no domain, no ?query. page_location holds the full URL. A pattern that includes https:// will never match page_path.
  3. Case-sensitive. /Blog/ ≠ /blog/ in GA4 filters.
  4. 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 wantRegex
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 wantRegex
Product detail /products/<slug>/products/[^/]+Try in tester →
Product listing only/productsTry 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 wantRegex
Paths ending in .pdf.*\.pdfTry in tester →
Any .html page.*\.htmlTry 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

Run a Google Analytics 4 page path regex check first
Paste real page path values, see every match highlight, then apply it in GA4. Free & private.
Open the GA4 regex tester →

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.