I am trying to assign some of the Event rule based target's attributes to some props. To do this, I would like to assign Data elements to the props in the interface, not insert Custom Code for each Event.
The idea would be to define Custom Code Data elements which return the desired attributes of the target element, but I don't know how to access the target from within the Data elements code.
Simply replace attribute_name in the example above with the actual name of the attribute you want (and do not wrap it in quotes like you might expect) and this will give you what you need.
That's just the message which I'm searching and sounds so good that you've explained, but unfortunatly (for me), tried to do it with a non good results, let me to explain.
So, as far as I know, right now Appmesurment haven't any method for deduplicate hits when having enable an automatic tracking links (Adobe Analytics UI on DTM) and also a one rule created for same purpose ( I'm referring solution like http://microsite.omniture.com/t2/help/en_US/sc/implement/link_functions.html), I've decided to use only the second one, meaning, on rule for detect a download links. That's seemed good for me, but the problem is when I need to assign a friendly name to my download link, seems DTM compels me use your UI, and for put into it a parameter that depending of the link ( like last slash parameter or whatever) I need use a Data Element, and is just for do that what I need apply your trick.
I tried to replicate exactly that you explained, but obviously something am doing wrong, attached you see screen of my rule and Data Element (And custom code into rule for filter different kind of dowloads). I'll very grateful if you can help me.
Because of the way the different pieces of code are scoped in the engine, the exact scenario you describe isn't possible. However, you could do something like this:
1) Create the data element(s) you want. Instead of referencing the target object directly, reference a copy of it (let's use "myTarget" in this example). We'll want to scope myTarget at the global level so it can be accessed anywhere. So, your data element might return something like "window.myTarget.href" if you wanted to return the URL of whatever link triggered a particular event based rule.
2) In your rules where you want to use these data elements, add a Custom criteria that contains the following:
var myTarget = this.target; return true;
This will make the "myTarget" object available globally, which means your data element(s) will be able to see it.
3) Use the data element normally within the rule UI using the %DataElementName% syntax.
So it does require a few more steps, but this would accomplish what you want. Hope this helps!