Skip to content

Fix incorrect GTM container IDs in xplat JP builds - #501

Open
viktorkombov with Copilot wants to merge 4 commits into
vnextfrom
copilot/fix-gtm-container-id-jp-builds
Open

Fix incorrect GTM container IDs in xplat JP builds#501
viktorkombov with Copilot wants to merge 4 commits into
vnextfrom
copilot/fix-gtm-container-id-jp-builds

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Xplat JP builds (React, WebComponents, Blazor) were resolving EN GTM container IDs instead of JP-specific ones because the fallback in getGtmContainerId() had no locale awareness — it was a flat map keyed only by build mode.

Changes

  • src/lib/platform-context.ts — Restructured GTM_CONTAINER_ID_DEFAULTS from Record<string, string> to Record<string, Record<string, string>> (locale → mode → container ID), and updated getGtmContainerId() to select the correct locale bucket using LANG_CODE before resolving by build mode. Unknown locales fall back to en defaults.
// Before
const GTM_CONTAINER_ID_DEFAULTS: Record<string, string> = {
    production: 'GTM-T65CF7',
    staging: 'GTM-NCKNPN',
    development: 'GTM-NCKNPN',
};

// After
const GTM_CONTAINER_ID_DEFAULTS: Record<string, Record<string, string>> = {
    en: { production: 'GTM-T65CF7', staging: 'GTM-NCKNPN', development: 'GTM-NCKNPN' },
    jp: { production: 'GTM-KVNSWJ', staging: 'GTM-WLWSDK', development: 'GTM-NNHVMC7' },
};

Resolution priority is unchanged: GTM_CONTAINER_ID env var → GTMContainerId from environment.json → locale-aware built-in defaults.

Co-authored-by: viktorkombov <75325639+viktorkombov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect GTM container ID in xplat JP builds Fix incorrect GTM container IDs in xplat JP builds Aug 17, 2026
Copilot AI requested a review from viktorkombov August 17, 2026 13:17
@viktorkombov
viktorkombov marked this pull request as ready for review August 18, 2026 11:40
@viktorkombov
viktorkombov requested a review from ChronosSF August 18, 2026 11:41
@ChronosSF ChronosSF added the 💥 status: in-test PRs currently being tested label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💥 status: in-test PRs currently being tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect GTM container ID in xplat JP builds

3 participants