Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

trackingfeature setting value

Avatar

Level 4

Hi,

 

In the page properties, we have a "View in Products" button that includes a trackingFeature attribute with the value aem:cifpage:preview. This setup works perfectly fine with the older AEM SDK.

However, after switching to the new SDK, the trackingFeature value is no longer being set when using the same aem:cifpage:preview value. While debugging the core code, I noticed that if I remove the colons (e.g., use aemcifpagepreview instead), the value is set correctly and everything works as expected.

This issue seems to be related to how the new SDK handles colon characters. Below is a reference to the file where this behavior is observed:

 
/libs/commerce/gui/components/authoring/editor/pagepreview/pagepreview.jsp

Attached below is a screenshot showing the working state when using the value without colons.


user96222_0-1744374361351.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Community Advisor

Hi @user96222,

In the newer AEM SDKs, especially starting from certain recent versions, there have been tightened restrictions or changes in how colon characters are handled, particularly in HTML attributes, data attributes, and tracking metadata. This is partly due to evolving standards and improvements in content security and HTML compliance.

Why colons (:) are causing issues now

  1. Colons are not valid characters in some HTML5 attribute names, especially in custom data-* attributes or JSX-style attributes that may be parsed differently.

  2. Older SDKs may have been more permissive or lenient, but the new SDKs sanitize or block those characters, leading to them being ignored or stripped when rendering or serializing DOM attributes.

  3. If the underlying component (like in your case /libs/commerce/gui/components/authoring/editor/pagepreview/pagepreview.jsp) tries to inject this attribute using a map or via element.setAttribute, and it hits a disallowed character like :, it silently fails or skips it.

What you can do

1. Use a safer naming convention:

If you're using the trackingFeature value just for analytics or DOM tracking, go with:

aemcifpagepreview
aem-cifpage-preview
aem_cifpage_preview

Any of those formats will be much safer and are future-proof across SDK versions and browsers.

2. Patch the JSP or adjust consumer logic:

If you have control over the /libs/commerce/gui/components/authoring/editor/pagepreview/pagepreview.jsp logic (via overlaying to /apps), you can sanitize or allow colons if absolutely necessary — though it's not recommended.

But in general, you're better off adapting your trackingFeature value to be colon-free.

Hope that helps!

Regards,
Santosh