DTM data layer | Community
Skip to main content
Level 3
October 16, 2015
Solved

DTM data layer

  • October 16, 2015
  • 4 replies
  • 1623 views

Can someone please share a code snippet or a sample of how we would populate the data layer in a CQ component to expose data to DTM?

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 Feike_Visser1

In your page template you can just add a code-snippet like

<script>

var digitalData={... your datalayer };

</script>

This way DTM can access it.

4 replies

aem_visiAuthor
Level 3
October 16, 2015

Great! Data Layer is clear

Regarding custom events such as lets say click of one of the social links. Do we implement something like ?

Code generate by component

<a href=”http://facebook.com” onclick=”trackClickInteraction();”>Social Link</a>

create a JS external file which is included in each page

this.trackClickInteraction = function() {

..........

s.tl(....);

}

Does the above seem like a reasonable solution? Do we need to include onClick event  and s.tl call, or DTM uses a different mechanism to capture custom events?

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

In your page template you can just add a code-snippet like

<script>

var digitalData={... your datalayer };

</script>

This way DTM can access it.

aem_visiAuthor
Level 3
October 16, 2015

Thanks for the reply

We are currently on an older version, CQ.5.5 . The aim is to 'somehow' populate the data layer, so the information populated are passed on to DTM

What i need to find out is how i populate the data layer object and also how  do we send custom events to DTM

Previously with direct sytecat  integration we would fire event tracking by using adv.trackEvent from s_code. How can we 

1) Populate and send data layer to DTM

2) Fire event tracking i.e. similar to sytecat adv.trackEvent

smacdonald2008
Level 10
October 16, 2015

Here is the official AEM docs on this subject:

http://docs.adobe.com/docs/en/aem/6-0/administer/integration/marketing-cloud/dtm.html

I will search to see if there are other pieces of content on this use case.