Create a Data Element for Page Name
Data elements are tags’ version of a data layer. They can store values from your own data layer object, cookies, local storage objects, query string parameters, page elements, meta tags, etc. In this exercise, you will create a data element for Page Name, which you will use later in your Target and Analytics implementations.
To create a data element
-
In the left navigation, click Data Elements
-
Since you haven’t created any data elements yet in this property, a brief video appears with additional information on this topic. Watch this video, if you like.
-
Click the Create New Data Element button:
-
Name the data element, e.g.
Page Name
-
Use the JavaScript Variable Data Element type to point to a value in your sample page’s data layer:
digitalData.page.pageInfo.pageName
-
Check the boxes for Force lowercase value and Clean text to standardize the case and remove extraneous spaces
-
Leave None as the Storage Duration setting since this value will typically be different on every page
-
Click the Save button to save the data element