Skip to content

feat: load Google Tag Manager (GTM-5WGTTWSF) on every hub page - #15

Merged
jlc488 merged 1 commit into
mainfrom
feat/gtm
Oct 5, 2026
Merged

jlc488 merged 1 commit into
mainfrom
feat/gtm

Conversation

@jlc488

@jlc488 jlc488 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

What

  • GTM on every shipped page. Google's official snippet, verbatim: the loader right after <meta charset>, the <noscript> iframe as the first element in <body>. Pages: index.html, gitlinq/index.html, gitlinq/docs/index.html (the hub has no 404 page or other HTML). The container already carries the GA4 Google tag (G-PVH5EZ8XPP), so nothing else is wired here.
  • No CSP to widen. The hub has no CSP meta tag and GitHub Pages sends no CSP header.
  • Privacy link in the footer. The company policy at https://devslab.kr/privacy/ is the policy for this hub; no separate policy is written here. The label uses the same 14 strings devslab.kr's own footer uses (개인정보처리방침, Privacy Policy, プライバシーポリシー, ...), swapped by the existing i18n apply(). The link carries ?lang=<locale> so the reader lands on the policy in the language they were reading (devslab.kr shows Korean, otherwise English; it does not persist a ?lang= value). Same .foot-links style as the neighbouring links; no external-link arrow.

Tests

tests/gtm.test.mjs (runs under npm test):

  • walks the tree for every .html file, so a page added later fails until it carries the container;
  • per page: exactly one loader, placed first after <meta charset>; the loader is executed in a VM and must request https://www.googletagmanager.com/gtm.js?id=GTM-5WGTTWSF; exactly one noscript, and it is the first element in <body>;
  • the footer link points at https://devslab.kr/privacy/ and its label map covers exactly the hub's SUPPORTED locales.

Red check: with one page reverted to main, the new suite fails 2 of 8.

Verification

  • npm test: 22/22 pass (run on an LF export of the commit; a Windows autocrlf checkout fails the existing brand-snapshot hash test regardless of this change).
  • Served locally with scripts/serve.mjs: window.google_tag_manager lists GTM-5WGTTWSF and G-PVH5EZ8XPP; dataLayer runs gtm.js, gtm.dom and gtm.load; requests went out to gtm.js?id=GTM-5WGTTWSF, gtag/js?id=G-PVH5EZ8XPP and a GA4 page_view collect.
  • Everything above the footer is pixel-identical to main at 1280 and 390, light and dark.
  • Footer at 1280/390 × light/dark × ko/en/ar: the new link has the same font, size, colour and 20px height as its siblings, with no horizontal overflow. At 390 it wraps to a second row with the existing 1.25rem gap.

Adds Google's GTM snippet to every HTML file the hub ships: the loader
right after <meta charset> and the noscript iframe as the first element
in <body>. Covers index.html and the two GitLinq move pages
(gitlinq/, gitlinq/docs/). The container already carries the GA4 tag
(G-PVH5EZ8XPP), so nothing else is wired here. The site has no CSP meta,
so no policy needed widening.

The footer gains a link to the company privacy policy
(devslab.kr/privacy/), which is the policy for this hub too. Its label
uses the same 14 strings devslab.kr's own footer uses, and the link
carries ?lang= so the reader lands on the policy in the language they
were reading (Korean, otherwise English). Same .foot-links style as the
neighbouring links, no external-link arrow.

tests/gtm.test.mjs walks the tree for every .html file and checks one
loader (run in a VM to confirm it requests this container's gtm.js),
placed first after <meta charset>, and one noscript opening <body>; a
page added later fails until it carries the container. It also checks
the privacy label covers exactly the hub's SUPPORTED locales.
@jlc488
jlc488 merged commit ddd1d8d into main Oct 5, 2026
1 check passed
@jlc488
jlc488 deleted the feat/gtm branch October 5, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant