Skip to content

Digitaldata pagetype ivent tracking for Adobe Analytics#722

Open
sumitverma13 wants to merge 2 commits into
mainfrom
digitaldata-pagetype
Open

Digitaldata pagetype ivent tracking for Adobe Analytics#722
sumitverma13 wants to merge 2 commits into
mainfrom
digitaldata-pagetype

Conversation

@sumitverma13

@sumitverma13 sumitverma13 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

@aem-code-sync

aem-code-sync Bot commented Jul 20, 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 Jul 20, 2026

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

/**
* @returns {string}
*/
function getStoreLocaleKey() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use getLocaleAndLanguage() for locale extraction here, with an instrumentation-specific fallback to us when the path lacks the normal /{region}/{locale}/ prefix. Bot requests such as /wp-admin otherwise create false store and category values in Adobe Analytics, polluting reports with a separate dimension value for each first path segment.

* Active language locale from URL (`/{locale}/{language}/...`).
* @returns {string}
*/
export function getActiveLanguageLocale() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getLocaleAndLanguage in scripts.js.

/**
* @returns {string}
*/
function getLocalePathPrefix() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getLocaleAndLanguage in scripts.js.

whenSatelliteReady(() => {
syncDigitalDataPageContext();
if (pageTypeGuardIntervalId) {
clearInterval(pageTypeGuardIntervalId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clears the page-type guard before its first interval tick. consented.js awaits the Launch script before calling initInstrumentation(), so _satellite.track is normally already available. whenSatelliteReady() therefore invokes this callback synchronously and cancels the 100 ms interval immediately. Any later Launch overwrite leaves pageType as defaultpage.

Reproduction:

  1. Open the branch on
  2. Set a breakpoint at line 802, immediately before whenSatelliteReady().
  3. Reload the page.
  4. While paused, run this in the console
  const expectedPageType = window.digitalData.page.category.pageType;

  setTimeout(() => {
    window.digitalData.page.category.pageType = 'defaultpage';
  }, 50);

  setTimeout(() => {
    console.log({
      expectedPageType,
      actualPageType: window.digitalData.page.category.pageType,
    });
  }, 250);
  1. Resume execution.

The result is { expectedPageType: 'Home', actualPageType: 'defaultpage' }. If the guard remained active for its intended window, the 100 ms synchronization would restore Home. Please keep the bounded guard running, or clear it only after a concrete Launch initialization-complete signal rather than when _satellite.track first becomes available.

category: {
...(window.digitalData.page?.category || {}),
pageType: categories.pageType,
primaryCategory: categories.primaryCat,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The post-Launch sync is erasing category values that Launch populated on generic CMS pages. I reproduced this on /us/en_us/why-vitamix?martech=on&instrumentation=debug by pausing at syncDigitalDataPageContext() in consented.js:54.

Before the sync, the real Launch values were:

  {
    pageType: 'defaultpage',
    primaryCategory: 'vitamix:us',
    subCategory1: 'vitamix:us:hh',
    subCategory2: 'vitamix:us:hh:why vitamix'
  }

After stepping over the sync:

  {
    pageType: 'Content',
    primaryCategory: '',
    subCategory1: '',
    subCategory2: ''
  }

The category values remained empty after 3 seconds. Correcting pageType to Content is expected, but the sync also removes the valid category hierarchy supplied by Launch.

Can syncDigitalDataPageContext() update only category.pageType, or preserve existing category values when the calculated replacements are empty?

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.

3 participants