Skip to main content
shubhamg9400285
New Participant
May 29, 2019

Context hub not working on publish environment?

  • May 29, 2019
  • 25 replies
  • 16781 views

Hi,

I am using context hub for personalization in a component.

for that, I created an audience for chrome users and Firefox users and the activities and so on.

So I authored different content for "default", chrome and firefox audience.

So it is working well and as expected on the author instance.

But when I view the page on PUBLISH environment it is showing default content only and not chrome or firefox content.

Tested on both AEM 6.4 and 6.5

P.S. I have activated page, audience, activities everything.

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

25 replies

Employee
June 4, 2019

shubhamg94002854

What you are facing may be expected behavior. Can you please review the note below in documentation [1]

ContextHub is not by default aware of the currently logged in used on publish servers and such users are regarded by ContextHub as “Anonymous.”

You can make ContextHub aware of logged in users by loading the profile store as implemented in the We.Retail reference site. Refer to the relevant code on GitHub here.

Basically, you may have to load some code (make an AJAX call) to load profile data into the store.

Hope this helps.

Best Regards,

Aneet Arora

[1] Adding ContextHub to Pages and Accessing Stores

shubhamg9400285
New Participant
June 4, 2019

yes i am quite sure this is a bug?

New Participant
June 4, 2019

I have the same issue as well. Different project but similar setup. We have even deep dived into the source code a bit to get the understanding if there's something missing but apparently not.

All the activities, segements are published.

contexthub and segment.seg.js file is also loaded into the network but apparently only after the restart of the publish its picking up the new changes. Seems like a bug ? Works fine on author.

Can you have a look at this ? kautuksahni

shubhamg9400285
New Participant
June 3, 2019

Sorry for late reply and yes above path is available.

Now a strage thing is happeniing, i restartwd aem publish instance and found context hub to be working fine.

Then i targeted another component which also didnt work. restarted the instance and it worked fine.

I dont understand what seems to be the problem. Any idea?

Employee
May 30, 2019

Go to crxde on publish and check if the custom contexthub data is available there?

Check the following paths:

/conf/we-retail/settings/wcm/segments