AEM Targeting on experience fragment | Community
Skip to main content
Level 2
August 19, 2022
Question

AEM Targeting on experience fragment

  • August 19, 2022
  • 1 reply
  • 736 views

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:

 

{"path":"//default","name":"default","title":"Default","campaignName":"","thumbnail":"/.thumb.png","url":"","campaignPriority":0,"tags":[]}

 

instead something like this

 

{"path":"//default","name":"default","title":"Default","campaignName":"","thumbnail":"/.thumb.png","url":"/_jcr_content/root/container/header/content/experiencefragment.default.html","campaignPriority":0,"tags":[]}

 

 

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?

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Community Manager
Community Manager
August 22, 2022

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-fragment-target-offer-feature-video-use.html?lang=en 

 

-Kautuk

Kautuk Sahni