I have a page at:
There's a data layer with an element 'planCategory'. In the console, I can access the element's value by typing:
But when I try to create a data element to do the same thing, I get empty quotes:
My attempts to create a functioning data element include:
- JS Object, with Path = window.consumerJSON.planProfiles.planCategory
- JS Object, with Path = consumerJSON.planProfiles.planCategory
- Custom Script, with window.consumerJSON.planProfiles.planCategory in the editor
So far, all of the above are giving me
in the console
Any ideas what I could do differently so that the data element populates with
So, the problem is that when you use a js Object reference, the path can't contain bracket accessors to an array element. So, you can use a custom script which you would do what you were doing above:
Try that out and see if it works. 🙂
That's great! You are welcome.
Will you go ahead and select that as the correct answers for future community comers?
That worked beautifully, thank you!
Sorry, it was un-published and I was using the testing plugin to access the staging DTM tag.
Should be there now...
I don't see that data element defined:
[img]Screen Shot 2014-06-06 at 12.05.44 PM.PNG[/img]