For more information on creating data elements, the documentation is available here.
Testing Data Elements
Before adding a data element to a rule, test that the expected value returns on the page. To test the data element is working, do the following:
- Navigate to a page where the data element is available on the site.
- Open the web console and type in _satellite.getVar(‘dataelementname’) and hit enter. This code returns any value that is present for the noted data element on that page.
- If the data element is working correctly, then the value is defined.
- If the value is undefined, then the data element is likely setup incorrectly. Check the custom script for syntax errors.
- If the value is null, then that data element does not have a value on that particular page. Try testing on another page before altering the data element setup.
- If there is an error '_satellite is not defined', there is a scoping issue. In order for '_satellite.getVar()' to have access to the global _satellite object, check the box 'execute globally' in the script editor.
Troubleshooting Data Elements
If the data element has a value when tested, but doesn't fire with the rule one of the following could be a problem:
- Setup - The data element can't retrieve the value of a custom script until it is called by a rule or tool within DTM. Check that the data element is called within a rule or tool.
- Timing - Check and see where the rule is loading in the rule condition. If it’s loading at Top of Page or Onload, then the data element is likely not available on the page yet when the rule fires. Try switching the rule to load at Bottom of Page or DOM Ready so the data element has more time to populate before the rules fires.
- Syntax Errors - Check the rule for syntax errors.
If the data element is still not populating contact support
, or open a thread in the DTM forum
for further assistance.
Data Element Documentation
Adobe Analytics Blog "Getting Started with DTM: Data Elements"