Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

AEM Targeting on experience fragment


Level 2

I have tried to use AEM targeting within experience fragment, so I have created audience, segments, activity etc... then I have created Header experience fragment and wanted to reconfigure Navigation component to show different links for anonymous and logged in users.


Targeting mode is available when authoring experience fragments (even in page properties you have got ContextHub configuration), so I thought it will work fine. However when I open the page where this experience fragment is used I see that page enters into the infinite loop and the "current url" is requested by ContextHub instead of url to campaign or experience fragment.


I have investigated in the page source that default segments got incorrect url:




instead something like this





When I use targeting on the page instead of experience fragment everything works fine. ContextHub is serving the correct fragment for resolved segment.


Do you have any idea how to fix it? or how to force targeting to works correctly on experience fragment?



1 Reply



I doubt if we can personalize Exp Fragment via contexthub. We can personalize content fragments but not ExP Fragment via Contexthub. Content Fragments are like Assets whereas ExP Fragments are like pages. So, for contexthub we can only change components value but not component type/order/count. I would recommend using Adobe target for it. 

See: http://www.sgaemsolutions.com/2018/12/personalization-using-contexthub-in-aem.html

See: https://experienceleague.adobe.com/docs/experience-manager-learn/sites/personalization/experience-fr... 



Kautuk Sahni