Expand my Community achievements bar.

DTM - Improve Data Element Field Syntax

Avatar

Level 9

3/9/17

I would like to see the %data_element% syntax expanded to be able to reference properties of returned objects. 

 

For example, currently in DTM you can do %data_element% syntax in various fields.  And for certain built-in data elements, you can e.g. %this.id% (reference to a clicked link's id attribute in an event based rule).

 

But I would like this to also be doable for arbitrary objects returned from data elements.

 

For example if I have the following on a page:

 

 

var dataLayer = { page: 'some page' }

 

If I create a data element named "dataLayer" of type js object type and point to dataLayer, it will return an object.  

 

Or alternatively if I create a data element of type custom script and it has 

 

return {page:'some page'}

 

Now if I use %dataLayer% in a field, it will return something along the lines of [object object] or else a stringified version of the object.   But if I try to do %dataLayer.page% then it will output that literal string because there is no data element of that name.  

 

So what I would like is to be able to do %dataLayer.page% and DTM output "some page".