iparsys with targetted component results in a nested homepage

Avatar

Avatar

hades0902

Avatar

hades0902

hades0902

04-03-2021

Hello folks, hope you are having a good day. I'm reaching you because I have the weirdest problem while targeting a component that lives in an iparsys. 

This is a little difficult to explain, so I'll do my best. 

 

Our footer is rendered inside an iparsys and inside our footer we have another parsys (not an iparsys) that is used to add a specific resource type. So, let's say that I target this component for x and y segments that are expecting x1 and y1 values in the cookie, respectively. If the cookie has x1 or y1, the respective targetted content is displayed. But, when the value is something that doesn't match the authored segments, let's say z1 what happens is that the whole homepage is rendered inside the parsys that holds the component targetted in the footer. So at the end it is some sort of "pageception" (the page, has the homepage loaded in the footer). This doesn't happen in the homepage but it does happen on the pages inheriting the iparsys footer content. 

 

I'm using the context hub for my targeting implementation and AEM 6.5.7.0.

 

Are there any open issues reported like this? Do you know how to fix this problem? Targeting works fine everywhere but in the iparsys. 

 

Thanks for your help 

AEM AEM 6.5 contexthub iparsys Segments targeting

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

rush_pawan

Avatar

rush_pawan

rush_pawan

05-03-2021

Hello,

 

I think iparsys by default configured for disable targeting, did you check that?? also, if underneath parsys component still targetable then check /libs/foundation/components/iparsys/iparsys.jsp from line 111 to 119, hope that will give some clue when debug.

 

THanks,

hades0902

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