Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Error while adding ContextHub to the page component

Avatar

Level 2

down votefavorite

Hi,

We have used Context Hub Parameters on Adobe Target Framework within Adobe Target cloud configuration.

However, when we have add the following line to add ContextHub to our page component:

<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>

I am getting error on the console as shown below: enter image description here

I tried resolving this but the effort was in vain.

Can anyone help me regarding this ?

Do we need to add some dependency for ContextHub in our clientlibs?

Thanks !

1 Accepted Solution

Avatar

Correct answer by
Level 2

Got the problem solved.

We need to add embed property in our clientlibs with these values:

1. jquery

2. granite.utils

3. granite.jquery

4. cq.jquery

5. cq.wcm.foundation

6. cq.wcm.foundation-main

Thanks !

View solution in original post

5 Replies

Avatar

Administrator

Can you increase the limit of org.apache.sling.engine.impl.SlingMainServlet (/system/console/configMgr under "Apache Sling Main Servlet) ->sling.max.calls=1000 to 2000/6000/15K+ (try all 3, 1 by 1). The intent of having this was to limit the number of nested/recursive calls.

Reference :-

1. https://mail-archives.apache.org/mod_mbox/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C1...

~kautuk



Kautuk Sahni

Avatar

Level 2

I tried with your solution, but it didnt work either.

Avatar

Correct answer by
Level 2

Got the problem solved.

We need to add embed property in our clientlibs with these values:

1. jquery

2. granite.utils

3. granite.jquery

4. cq.jquery

5. cq.wcm.foundation

6. cq.wcm.foundation-main

Thanks !

Avatar

Level 10

Thank for you for posting. For those reading this thread and wanting to know how to get ContextHib into an AEM page -- see this artilce:

Scott's Digital Community: Using the ContextHub with the Experience Manager Toy Store site

Avatar

Level 2

Follow the url Uncaught TypeError: Cannot read property 'externalize' of undefined · Issue #107 · adobe/aem-project...

and add the below in your header lib file

<!--/* Include Context Hub */-->
<sly data-sly-call="${clientlib.js @ categories='granite.utils'}"/>
<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>