Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Context hub not working on publish environment?

Avatar

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
shubhamg9400285
Level 2

29-05-2019

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.

Replies

Avatar

Avatar
Coach
Employee
jbrar
Employee

Likes

388 likes

Total Posts

869 posts

Correct Reply

283 solutions
Top badges earned
Coach
Establish
Give Back 50
Give Back 5
Give Back 3
View profile

Avatar
Coach
Employee
jbrar
Employee

Likes

388 likes

Total Posts

869 posts

Correct Reply

283 solutions
Top badges earned
Coach
Establish
Give Back 50
Give Back 5
Give Back 3
View profile
jbrar
Employee

30-05-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

Avatar

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
shubhamg9400285
Level 2

03-06-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?

Avatar

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
timmymathew
Level 2

04-06-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

Avatar

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
shubhamg9400285
Level 2

Likes

13 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
shubhamg9400285
Level 2

04-06-2019

yes i am quite sure this is a bug?

Avatar

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
aneeta45259594
Level 4

04-06-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

Avatar

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
timmymathew
Level 2

04-06-2019

Hi Aneet,

       Issue is not related to the context awareness of logged in users. I also tested it with logging into publish instance with admin account and still its the same issue unfortunately 😕

PS : Tested with We-Retail of vanilla 6.5 instance and it's the same issue so not specific to any project or configuration.

Thanks and regards,

Timmy

Avatar

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
aneeta45259594
Level 4

04-06-2019

Hello timmymathew

Thank you for clarifying. You may be facing something different from the original poster.

Are you able to check the details in the browser's console for loaded Store data? You can execute commands such as the following

ContextHub.getStore("profile").getItem("displayName")

to check if the Profile store is getting populated.

Thank you,

Aneet Arora

Avatar

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Level 2
timmymathew
Level 2

Likes

6 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
timmymathew
Level 2

04-06-2019

Hey Aneet,

          Yes Im able to get the data. So basically all the scripts are loaded and contexthub is also initialized. I can also see that the data is getting stored into the store.

This is very much identical to the original poster. If I restart my publish instance then it seems to work fine. To check this I also tested this on vanilla 6.4 and 6.5 instance it doesn’t work.

On author instance it also work for 6.4 and 6.5. So something very specific to publisher. Permission is not the issue have already tested that part.

It does work in 6.3. So I think something within the engine got screwed up during repository restructuring from 6.4 onwards.

You can also reproduce this very easily in any 6.4 or 6.5 instance as below.

Create any page under we-retail. Add a title component. And target it with audience male and female. Then I use this to trigger it to check on author and publish which works fine on author and not on publish.

var a = ContextHub.getStore(’profile’);

a.setItem(‘gender’,’male’);

Thanks and regards,

Timmy

Avatar

Avatar
Give Back 5
Level 4
joeb21688728
Level 4

Likes

33 likes

Total Posts

60 posts

Correct Reply

8 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 4
joeb21688728
Level 4

Likes

33 likes

Total Posts

60 posts

Correct Reply

8 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
joeb21688728
Level 4

04-06-2019

ContextHub is a tool that is meant for Author.