Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM - Improve Data Element Field Syntax

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

09-03-2017

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".