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?