Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

Why GTM's RegEx Table Silently Drops Every Row (Unless You Clear One Checkbox)

GA4 has no native "content group" regex UI. The standard recipe is a Google Tag Manager RegEx Table variable feeding the content_group parameter into the GA4 Configuration tag. Simple in theory - until every row lands in

GA4 has no native "content group" regex UI. The standard recipe is a Google Tag Manager RegEx Table variable feeding the content_group parameter into the GA4 Configuration tag. Simple in theory - until every row lands in "Other".

If that's you, the trap is one checkbox: Full Matches Only, which ships checked by default in every new RegEx Table variable.

What the default breaks

  • /blog/ as a Pattern matches exactly the string /blog/ and nothing else.
  • /blog/my-post sails straight past it into your Default Value.
  • Every page ends up in "Other".

The fix

Variables -> New -> RegEx Table -> Advanced Settings -> uncheck Full Matches Only (and Enable Capture Groups and Replace Functionality). Leave Ignore Case checked - GTM evaluates case-insensitively by default, while GA4 itself is case-sensitive.

Row order = precedence (first match wins)

Put narrow rows above catch-alls, or the widest row swallows everything:

^/lp/           -> Landing Page
^/docs/         -> Docs
^/blog/         -> Blog
^/products/     -> Products
# Default Value: Other

Test before you publish

Drop each pattern + a real path into RegexLab (free, in-browser regex tester built for GA4's full-match/RE2 semantics): https://regextester.site/ga4-content-groups-regex/

The full walkthrough (GTM setup steps, the content_group field name, the 24-48h lag, no historical backfill, six ready-made patterns) is there.

RegexLab is a free, browser-only regex tester focused on GA4: https://regextester.site/

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.