Expand my Community achievements bar.

SOLVED

AEM Integration with DTM - Getting Data Element Error

Avatar

Level 1

Hi, I work for a company that has been using DTM for a couple of years. We have recently decided to use the ContextHub data layer within AEM instead of a custom solution outside of AEM. After configuring AEM to DTM and adding DTM as a tool at the site level, we are starting to add in Data Elements. We are currently getting the following error. TypeError - ContextHub.getItem is not a function

Can anyone help with this issue?

1 Accepted Solution

Avatar

Correct answer by
Administrator

Not sure completely. But, have you added ContextHub to the page component? Can you directly access contexthub functions from browser console on the AEM Web-page(s)?

See Adding ContextHub to Pages and Accessing Stores

To enable the ContextHub features and to link to the ContextHub Javascript libraries, include the contexthub component in the head section of your page. The JSP code for your page component resembles the following example:

<head>

   <sling:include path="contexthub" resourceType="granite/contexthub/components/contexthub" />

</head>

Reference Read:- Configuring ContextHub



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Correct answer by
Administrator

Not sure completely. But, have you added ContextHub to the page component? Can you directly access contexthub functions from browser console on the AEM Web-page(s)?

See Adding ContextHub to Pages and Accessing Stores

To enable the ContextHub features and to link to the ContextHub Javascript libraries, include the contexthub component in the head section of your page. The JSP code for your page component resembles the following example:

<head>

   <sling:include path="contexthub" resourceType="granite/contexthub/components/contexthub" />

</head>

Reference Read:- Configuring ContextHub



Kautuk Sahni