Expand my Community achievements bar.

SOLVED

Data Layer for DTM

Avatar

Level 3

Hello,

We have Site Catalysts fully functional across enterprise applications. We want to migrate to DTM.

I have couple of questions:

1. Should the Data Layer be created in the Tag Manager Interface by defining various data elements that we access from the page OR should the data layer be part of the application (as JSON Object)?

2. Assuming Data Layer is created in the application, where should it be created? In the Header, Footer, or start / end of the body tag? Please note that this data layer will contain Global Variables (which fires on every page), page specific variables and variables that will be populated based on User Actions.

Do we have any documentation for best practices or any good article?

Appreciate your help.

Sameer Khaladkar.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Sameer,

1. Either or both, whichever is easier for you. Data Elements can be used to hold values of DOM elements that already exist on your pages, or for values that you instantiate, manage, and manipulate entirely in DTM. If you already have metadata in meta tags, in custom data attributes, or elsewhere in your markup or the DOM, feel free to use Data Elements in DTM (with those values) as part of your overall data layer.

2. In terms of 'where': specific values for different elements of your data layer will be available at different points in time - like DOM ready, or on the load event, or after a particular user action. When you're building rules in DTM for data collection, you can control when and where those rules are triggered using Conditions. As long as your Conditions are triggered when your data layer values are available, your data collection should function as expected.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi Sameer,

1. Either or both, whichever is easier for you. Data Elements can be used to hold values of DOM elements that already exist on your pages, or for values that you instantiate, manage, and manipulate entirely in DTM. If you already have metadata in meta tags, in custom data attributes, or elsewhere in your markup or the DOM, feel free to use Data Elements in DTM (with those values) as part of your overall data layer.

2. In terms of 'where': specific values for different elements of your data layer will be available at different points in time - like DOM ready, or on the load event, or after a particular user action. When you're building rules in DTM for data collection, you can control when and where those rules are triggered using Conditions. As long as your Conditions are triggered when your data layer values are available, your data collection should function as expected.