10. Data Definitions
This comprehensive course covers everything you will need to become a Manage power user - from deploying tags, data layers and event tracking to organizing your TMS strategy and properly QA and troubleshoot.
Learners should have a basic grasp of client-side web technologies.
Hello. Welcome back to the Ensighten Manage Training Series. Today we'll be discussing data definitions which, if you're here for a refresher after some years away, they were previously known as the Ensighten Data Layer or EDL. The name change was due to how confusing it might seem to have both an on-page data layer and an Ensighten Data Layer and it was a bit of a misnomer anyway since the data definitions don't actually create or store data on their own.
Let's start in the UI and we'll build up to the use case where the benefits become clear. You'll see the normal search and sort options are present as they were in the tags and conditions. In the details view you'll find the extraction, transformation and trigger boxes which I'll explain momentarily and some familiar boxes like history, conditions, spaces and tags. The creation of a data definition has a lot of build options and some can be quite complicated. You'll find that each of the four options here at the top offers a dropdown asking where to get the data from. A first-party cookie is any cookie that's accessible via read and write from the page.
Once you've filled in the data extraction source, you'll also see the box for modify value. Checking this gives you another dropdown with options and custom at the end in case they don't fit your needs. This is the transformation box you saw on the details view and serves to modify the value you retrieved via extraction should you need to do so. Then there's the advanced settings options here. First, you'll see a persistence dropdown which lets you govern whether the extracted value of your data definition will be stored as a cookie for the length of the user session or a full year or only exist during the lifetime of a page the user is visiting.
If you are, then setting up a promise and resolve function here should already be clear to you. For the sake of your general knowledge, a promise setup here allows you to define a very specific and sometimes multilayered resolution decision so you know exactly when and why your extraction function is executing. Following the implementation steps, you continue to a space selection field. And you can define if the data definition is available on all spaces or some subset. Next, you'll see the condition step which follows the same logic as our tagging conditions you saw on a previous video. With your spaces and conditions selected wrap up the configuration by clicking save at the bottom.
Now that you have a data definition set up, we'll return to tags and fulfill a promise I made to you previously. You recall inside the apps many of the fields come with a dropdown that allows you to choose the method by which your variable is set and one of those options is Ensighten data layer. This should probably be updated to read data or data definition in the future and by the time you're watching this, perhaps that's what it says. When you select this option, you'll find the input field changes to select an element and clicking that, you'll see a list of all data definitions. Selecting one of the options here automatically sets this tag up to use that data definition's extraction function as a source for the data in this field.
An important note. By invoking these calls by hand, you bypass the data definitions' configured timing options such as bottom of body or a custom promise set up. Asynchronously, if you pass in an array of string ID values and a callback function with one argument per string in your array, the callback function will retrieve your values and store them in that callback function document.
Synchronously, you simply don't supply the callback function and you can pass in a string without the array brackets and that can be either the ID or a friendly name that follows the syntax source dot collection dot name. Source is always going to be manage. Collection and name are defined during your data definition creation process. This will always return the data definition's output but if it wasn't already a string, it will be now. If you passed in an array, you can supply multiple IDs or names and you will receive an array of strings back. Most of the time you're using data definitions it will be for apps with the helpful dropdowns so I wouldn't worry if that last part about the JS calls went over your head.
That's all for the data definitions video. Next up, we'll be covering custom and generic tagging.