From 9e0557eeacf74b4e5bc580dbb3f9f5c595f3e8d9 Mon Sep 17 00:00:00 2001 From: Andrew Yim Date: Sat, 21 Mar 2026 01:23:40 +0900 Subject: [PATCH] docs(gtm): add content grouping gotchas and RegEx Table reference New section in common_issues.md covering: - How RegEx Table content grouping works in GTM - Common pitfall: new page paths falling to "Other" - Gotcha: parallel Path/URL variables must stay in sync - JHR content group category reference table - Audit checklist for content grouping Co-Authored-By: Claude Opus 4.6 (1M context) --- .../60-gtm-audit/code/docs/common_issues.md | 81 +++++++++++++++++++ .../61-gtm-manager/code/docs/common_issues.md | 81 +++++++++++++++++++ 2 files changed, 162 insertions(+) diff --git a/custom-skills/60-gtm-audit/code/docs/common_issues.md b/custom-skills/60-gtm-audit/code/docs/common_issues.md index 42b1af6..eafa371 100644 --- a/custom-skills/60-gtm-audit/code/docs/common_issues.md +++ b/custom-skills/60-gtm-audit/code/docs/common_issues.md @@ -196,6 +196,87 @@ dataLayer.push({ --- +## Content Grouping Issues (RegEx Table Variables) + +### How Content Grouping Works in GTM + +Content grouping uses **RegEx Table** variables to categorize pages by URL/path patterns. +The variable takes an input (typically `{{Page Path}}` or `{{Page URL}}`), tests it against +an ordered list of regex patterns, and returns the first matching output value. +If no pattern matches, it falls to the **Default Value** (usually "Other"). + +**Key settings:** +- **Full Matches Only**: OFF — partial regex match is sufficient +- **Capture Groups and Replace**: OFF — output is the literal value, not a regex replacement +- **Ignore Case**: ON — case-insensitive matching + +### New Page Paths Fall Through to "Other" + +**Symptoms**: New sections (campaigns, special events, landing pages) show as "Other" in GA4 content group reports. + +**Root cause**: The RegEx Table was built for the site's original URL structure. New paths like `/specialEvent/`, `/campaign/`, `/timesale/` don't match any existing pattern. + +**Example**: JHR site has `/specialEvent/landersshoppingfesta2026/teaser.do` but only `/package/` and `/event/` are in the regex table, not `/specialEvent/`. + +**Fix**: Add regex rule for the new path pattern. Place it BEFORE the default. + +**Gotcha — two variables to update**: Sites often have parallel content group variables: +1. **Page Path based** (e.g., `(\/m)?\/specialEvent\/(.*)`) — for internal reports +2. **Page URL based** (e.g., full URL with domain regex) — for cross-domain or subdomain tracking + +Both must be updated or they'll produce inconsistent groupings. + +### RegEx Pattern Conventions (JHR Example) + +Page Path patterns follow this structure: +``` +(\/m)?\/section\/(.*) → Korean Category Label +``` +- `(\/m)?` — optional mobile path prefix +- `\/section\/` — the URL path segment to match +- `(.*)` — match anything after + +Page URL patterns include domain matching: +``` +^https\:\/\/(www|app|jpg|gjb|gjj|grp|\.)?josunhotel\.com(\/m)?\/section\/(.*) +``` +- Multi-subdomain support via alternation group +- Same `(\/m)?` mobile prefix handling + +### Content Group Categories (Hospitality Reference) + +| Pattern | Category (KR) | Category (EN) | +|---------|---------------|---------------| +| `/intro.do`, `/main.do` | 메인페이지 | Main Page | +| `/about/`, `/press/` | 기업 소개 | Corporate Info | +| `/hotel/` | 호텔 소개 | Hotel Info | +| `/rooms/` | 객실 소개 | Room Info | +| `/dining/` | 다이닝 이용 | Dining | +| `/facilities/`, `/meeting/`, `/fitness/` | 부대시설 소개 | Facilities | +| `/package/`, `/event/` | 이벤트 \| 패키지 조회 | Events & Packages | +| `/specialEvent/`, `/timesale/`, `/campaign/` | 캠페인 \| 프로모션 | Campaign & Promotion | +| `/activity/` | 액티비티 소개 | Activities | +| `/step[0-4]` | 룸, 패키지 예약 프로세스 | Booking Process | +| `/resve/dining/` | 다이닝 예약 프로세스 | Dining Booking | +| `/membership/` | 멤버쉽 | Membership | +| `/mypage/`, `/login/`, `/join/` | 웹회원 관련 | Member Portal | +| `/retail/`, `/product/`, `/office/` | 리테일 관련 | Retail | +| `/voc/`, `/customer/` | 고객지원 | Customer Support | +| `/policy/` | 웹사이트 정책 | Website Policy | +| `/upload_file/event/html/` | 캠페인 \| 프로모션 | Campaign & Promotion | +| Default | Other | Other | + +### Audit Checklist for Content Grouping + +- [ ] Run `dtm var info ` to dump the full regex table +- [ ] Check if new site sections have matching patterns +- [ ] Verify both Path and URL variables are in sync +- [ ] Check GA4 config tag references the correct variable +- [ ] Test in GTM Preview: navigate to new page, check variable value +- [ ] After update, verify in GA4 Realtime > Content Group report + +--- + ## Performance Issues ### Tags Slowing Page Load diff --git a/custom-skills/61-gtm-manager/code/docs/common_issues.md b/custom-skills/61-gtm-manager/code/docs/common_issues.md index 42b1af6..eafa371 100644 --- a/custom-skills/61-gtm-manager/code/docs/common_issues.md +++ b/custom-skills/61-gtm-manager/code/docs/common_issues.md @@ -196,6 +196,87 @@ dataLayer.push({ --- +## Content Grouping Issues (RegEx Table Variables) + +### How Content Grouping Works in GTM + +Content grouping uses **RegEx Table** variables to categorize pages by URL/path patterns. +The variable takes an input (typically `{{Page Path}}` or `{{Page URL}}`), tests it against +an ordered list of regex patterns, and returns the first matching output value. +If no pattern matches, it falls to the **Default Value** (usually "Other"). + +**Key settings:** +- **Full Matches Only**: OFF — partial regex match is sufficient +- **Capture Groups and Replace**: OFF — output is the literal value, not a regex replacement +- **Ignore Case**: ON — case-insensitive matching + +### New Page Paths Fall Through to "Other" + +**Symptoms**: New sections (campaigns, special events, landing pages) show as "Other" in GA4 content group reports. + +**Root cause**: The RegEx Table was built for the site's original URL structure. New paths like `/specialEvent/`, `/campaign/`, `/timesale/` don't match any existing pattern. + +**Example**: JHR site has `/specialEvent/landersshoppingfesta2026/teaser.do` but only `/package/` and `/event/` are in the regex table, not `/specialEvent/`. + +**Fix**: Add regex rule for the new path pattern. Place it BEFORE the default. + +**Gotcha — two variables to update**: Sites often have parallel content group variables: +1. **Page Path based** (e.g., `(\/m)?\/specialEvent\/(.*)`) — for internal reports +2. **Page URL based** (e.g., full URL with domain regex) — for cross-domain or subdomain tracking + +Both must be updated or they'll produce inconsistent groupings. + +### RegEx Pattern Conventions (JHR Example) + +Page Path patterns follow this structure: +``` +(\/m)?\/section\/(.*) → Korean Category Label +``` +- `(\/m)?` — optional mobile path prefix +- `\/section\/` — the URL path segment to match +- `(.*)` — match anything after + +Page URL patterns include domain matching: +``` +^https\:\/\/(www|app|jpg|gjb|gjj|grp|\.)?josunhotel\.com(\/m)?\/section\/(.*) +``` +- Multi-subdomain support via alternation group +- Same `(\/m)?` mobile prefix handling + +### Content Group Categories (Hospitality Reference) + +| Pattern | Category (KR) | Category (EN) | +|---------|---------------|---------------| +| `/intro.do`, `/main.do` | 메인페이지 | Main Page | +| `/about/`, `/press/` | 기업 소개 | Corporate Info | +| `/hotel/` | 호텔 소개 | Hotel Info | +| `/rooms/` | 객실 소개 | Room Info | +| `/dining/` | 다이닝 이용 | Dining | +| `/facilities/`, `/meeting/`, `/fitness/` | 부대시설 소개 | Facilities | +| `/package/`, `/event/` | 이벤트 \| 패키지 조회 | Events & Packages | +| `/specialEvent/`, `/timesale/`, `/campaign/` | 캠페인 \| 프로모션 | Campaign & Promotion | +| `/activity/` | 액티비티 소개 | Activities | +| `/step[0-4]` | 룸, 패키지 예약 프로세스 | Booking Process | +| `/resve/dining/` | 다이닝 예약 프로세스 | Dining Booking | +| `/membership/` | 멤버쉽 | Membership | +| `/mypage/`, `/login/`, `/join/` | 웹회원 관련 | Member Portal | +| `/retail/`, `/product/`, `/office/` | 리테일 관련 | Retail | +| `/voc/`, `/customer/` | 고객지원 | Customer Support | +| `/policy/` | 웹사이트 정책 | Website Policy | +| `/upload_file/event/html/` | 캠페인 \| 프로모션 | Campaign & Promotion | +| Default | Other | Other | + +### Audit Checklist for Content Grouping + +- [ ] Run `dtm var info ` to dump the full regex table +- [ ] Check if new site sections have matching patterns +- [ ] Verify both Path and URL variables are in sync +- [ ] Check GA4 config tag references the correct variable +- [ ] Test in GTM Preview: navigate to new page, check variable value +- [ ] After update, verify in GA4 Realtime > Content Group report + +--- + ## Performance Issues ### Tags Slowing Page Load