Expand my Community achievements bar.

How to set dataelement value with AEM ContextHub?

Avatar

Level 6

I added the contextHub tool. To test out that I can set dataelement value with contextHub, I  created a data element and let it equal to surfinfo.browser.family. then I assign this dataelement to a prop. I expect to get value = 'Chrome'. But I can not get any value.

I want to know what I may did wrong.

Thanks,

-Cathy

contextHub.PNG

2 Replies

Avatar

Level 6

I just noticed that in the console, if I call:

ContextHub.getItem('store/surferinfo/browser/family')

"Chrome"

I can get Chrome returned. To me, in the path, I still have "store" in the path. But in the dataelement, when I select the path, I only can select "surferinfo.browser.family

Then I noticed that, in the added AEM ContextHub tool, if I select " Use default Data Layer", then everything worked. But if I chnage to "Customize ContextHub Data layer" and then put "ContextHub" as the Data Later Root, I can not get "Chrome" in the dataelement. I got "SATELLITE: TypeError - Cannot read property 'surferinfo' of undefined" Most likely the root path is incorrect. Any one know how to set up the root path?

Avatar

Level 1

HI

How to restrict the multifield limit in classic ui by using listners