Website dataLayer
Create custom parameters in Digital for customers who use Adobe, Google Tag Manager (GTM), or Analytics products to present or manage the metadata that is specific to their business or users. These products often use a JavaScript array object called a dataLayer. To map an item in the dataLayer array to a Digital custom parameter you need the numerical index of the item in the array.
To identify the dataLayer object in the browser and find the index of an item:
Open the web page you want to check in a web browser. Then open the inspect feature in the developer console.
Note: The steps to open the developer console are slightly different for each browser. In Chrome, right-click the web page you want to inspect and select Inspect > Developer Console.Select the Console menu item and search for "dataLayer". As you type, your browser displays autocomplete options. Select dataLayer.
Hit Enter to generate the array.
Click the down arrow to the left of the array to view all objects within it. Make a note of the number (array index) that contains the data you want to capture as part of the survey feedback item. This is required when creating the custom parameter.
Log in to Digital Feedback (see Getting started for details on logging in).
In Custom Parameters, click Add New.
Configure the custom parameter as follows:Parameter Name — Internal name that is displayed in reports and in the inbox. Assign a parameter name that is easily recognizable by customers (i.e., 'loggedIn').
Parameter Type — Select the data type of the parameter you are going to collect (i.e., text, number, boolean, date, time). Unless you intend on performing mathematical comparisons (i.e., greater than, smaller than), always select Text.
Origin Type — Select Var for Variable.
Origin Name — Because this is an array, the syntax required is dictated by the structure of the array. Typically, it looks like
dataLayer.X.parameter
where X is the index number of the item in the array, and parameter is the name of the item. Based on the dataLayer array shown in step 4, to use the parameter name 'loggedIn', enterdataLayer.0.loggedIn
as the Origin Name.Attach Forms — Select the survey to which the custom parameter applies.
For more information, see Setting up custom parameters.
- Test the parameter in a QA environment.
Go to your inbox and confirm that the value appears in the Feedback Item section.