Skip to content

[MAIN] STERICMS-959 — OneTrust cookie banner reappears after Accept/Reject on non-production hosts#1056

Merged
rene-davila-hero merged 1 commit into
mainfrom
bugfix/STERICMS-959-onetrust
Jul 1, 2026
Merged

[MAIN] STERICMS-959 — OneTrust cookie banner reappears after Accept/Reject on non-production hosts#1056
rene-davila-hero merged 1 commit into
mainfrom
bugfix/STERICMS-959-onetrust

Conversation

@Mao8a

@Mao8a Mao8a commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

STERICMS-959 — OneTrust cookie banner reappears after Accept/Reject on non-production hosts
https://herodigital.atlassian.net/browse/STERICMS-959

Root cause

scripts/otconfing.js defaulted any unmatched host to the production OneTrust domain script (94a9f9f7-2ccd-4f46-b1a1-d11d479ed08c), which OneTrust authorizes only for shredit.com. Preview (*.aem.page), live mirror (*.aem.live), and localhost fell through to that production ID, so consent could not be recorded and the banner reappeared after every Accept/Reject. Only reproduces from consent-required regions (e.g. Bogotá/EU), not US regions.

Fix

Rewrote getOneTrustConfig() in scripts/otconfing.js to return the production config only for the production domains and the -test config as the fail-safe default for every other host:

export default function getOneTrustConfig(pageUrl) {
  if (/^https?:\/\/(www\.)?shredit\.com(\/|$)/.test(pageUrl)) return PROD_CONFIG;
  return TEST_CONFIG;
}

TEST_CONFIG uses domain script 94a9f9f7-2ccd-4f46-b1a1-d11d479ed08c-test. No change to shredit.com / www.shredit.com, no new dependencies, no build step, aem.js untouched.

Test URLs

OneTrust only renders the banner from a consent-required region (e.g. Bogotá/EU) — not from US regions.

Before:

After:

@aem-code-sync

aem-code-sync Bot commented Jun 24, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Jun 24, 2026

Copy link
Copy Markdown
Page Scores Audits Google
📱 /en-us PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /en-us PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@Mao8a Mao8a requested a review from rene-davila-hero June 24, 2026 21:22
@rene-davila-hero rene-davila-hero merged commit 83290bb into main Jul 1, 2026
1 of 2 checks passed
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.

2 participants