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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM Integration with DTM - Getting Data Element Error

Antdogg1006
Level 1
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
kautuk_sahni
Correct answer by
Community Manager
Community Manager

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

View solution in original post

2 Replies
kautuk_sahni
Correct answer by
Community Manager
Community Manager

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

View solution in original post