GTM template variable to validate dataLayer
Validation data is one of the most important steps in the process of creating a robust, accurate, and reliable data collection pipeline. Validating the Data Layer for incomplete property values is a common task
Task
GTM Custom Template Variable to validate the quality of dataLayer that will return the keys (in GTM notation) for all values that are null, undefined, or empty strings. Otherwise, the template should return false.
Solution
To import a template:
- In Tag Manager, click Templates.
- Click New. This will open a blank template in the Template Editor.
- Click the More Actions menu (more_vert) and select Import.
- Select the .tpl file that you would like to import Source code
Use cases
Create tag with template variable
Run debuging mode
Check value of variable
Send test event and see the results