Expand my Community achievements bar.

DTM - How to update a pre-defined Data Element

Avatar

Level 2

I can't figure out how to dynamically update a pre-defined data element? For example if you are capturing onClick a custom HTML-5 attribute ('data-analytics-tracking-name') value and you want to update a pre-defined data element ('custom link name') with that new value? I can do it with a dynamically created data element as per below but not with a pre-defined data element?


var linkName = this.getAttribute('data-analytics-tracking-name');
_satellite.setVar('custom link name', linkName);
return true;
 

3 Replies

Avatar

Level 10

Hi There,

Thanks for reaching out to Adobe Community.

Please go through the below mentioned Data Elements doc to see how to work with data elements:

https://marketing.adobe.com/resources/help/en_US/dtm/data_elements.html

Thanks!

Avatar

Level 2

Hi,

Please re-read my question as it is very specific and the document you pointed me to does not answer my question. I have scoured the web and can't find an answer yet?

 

Thanks,

Michael

Avatar

Level 8

Hi Michael,

One way you could go about this is by creating a dynamic data element and then setting a default value into it (when you create that data element).

Once the element is created, you can reference it in your code when you need to.

Please let me know if this helps

Regards

Rahul