Hello, thanks for replying. I looked at that code, but I'm not sure if the problem is there. I think this is more a context hub issue.
Why you may ask? Because AEM injects scripts like this in the page source when it has targeted components
ContextHub.SegmentEngine.PageInteraction.Teaser({
locationId: 'somelocationid',
variants: [{"path":"/content/campaigns/brand/en/market/segment/component",
"name":"name",
"title":"A title",
"campaignName":"campaign name",
"campaignPath":"/content/campaigns/brand/en/market",
"thumbnail":"/content/campaigns/brand/en/market/component.thumb.png",
"id":"a_market_campaign",
"url":"/content/campaigns/brand/en/market/a_segment/component/jcr:content/par.html",
"campaignPriority":1,
"segments":["/conf/br/settings/wcm/segments/market"],
"tags":[]
},
{
"path":"/en/a-page/url/here/default",
"name":"default",
"title":"Default",
"campaignName":"",
"thumbnail":"/en/a-page/url/here/.thumb.png",
"url":"",
"campaignPriority":0,
"tags":[]
}
The first object there represents the content authored for one of the segments, the other is the default content that should load if the cookie doesn't match any of the authored segments. As you can see it is empty and I think that is the reason that it is loading the homepage, because the context hub is just fetching the homepage over and over again.
When a component is targerted outside an iparsys, then the default object in the script looks like this:
{
"path":"/content/brand/en/testing/atest/default",
"name":"default",
"title":"Default",
"campaignName":"","thumbnail":"/content/brand/en/testing/atest.thumb.png",
"url":"/content/brand/en/testing/atest/_jcr_content/main/items/a-par/container/container-par/acomponent.default.html",
"campaignPriority":0,
"tags":[]
}
See how the default does have a URL in this case