AEM Integration with DTM - Getting Data Element Error | Community
Skip to main content
Antdogg1006
June 13, 2018
Solved

AEM Integration with DTM - Getting Data Element Error

  • June 13, 2018
  • 2 replies
  • 944 views

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?

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

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

2 replies

jantzen_b
Adobe Employee
Adobe Employee
June 14, 2018

kautuksahni​ - Any ideas here?

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
June 18, 2018

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