Contexthub default
AEM as a Cloud Service is being used with ContextHub for personalization. After compilation, 32 JavaScript files(These files are already exists in code) are bundled into contexthub.kernel.js.
A requirement exists to create a custom default segment that differs from AEM’s OOTB DEFAULT segment.
The custom default segment was created using the following JavaScript:
JavaScript(function () { 'use strict'; var MyDefaultSegment = function () { return true; }; /* register function */ ContextHub.SegmentEngine.ScriptManager.register( 'Region-Default', MyDefaultSegment );})();Show more lines
Scoring configuration:
All region-specific segments (for example, Region-AA) are assigned a boost of 500
Region-Default is assigned a boost of 2 (minimum boost)
This works as expected when content is authored for all regions on the page.
The issue occurs when a region-specific segment (for example, Region-AA) is resolved but no content is authored for that segment. In this scenario:
ContextHub does not fall back to Region-Default
The page renders as empty
Inspecting the page shows that ContextHub.SegmentEngine.getResolvedSegments() returns both Region-AA and Region-Default
The requirement is that only Region-Default should be applied and rendered when no content exists for the resolved segment (Region-AA).
Thanks in advance for helping me resolve this issue.