DTM - Attach click even to a link that doesn't have ID | Adobe Higher Education
Skip to main content
Level 2
January 5, 2017
Respondido

DTM - Attach click even to a link that doesn't have ID

  • January 5, 2017
  • 2 respostas
  • 1109 Visualizações

Hi,

I have a page that has a link. Unfortunately the link does not have an ID and I can't add one (technical issues with CMS). I have jQuery/JS code that can listen for the link click and fire a pixel, but I'm not sure how to create the rule in DTM.

The jQuery is something like this:

$("a").click(function(){

    if($("a").attr('data-utc')=="12345")
       //Fire pixel    
});

Any idea how to create such custom rule in DTM?

Este tópico foi fechado para respostas.
Melhor resposta por ParitMittal

Hi Amin,

For your Use-case you can create  Create an Event based rule with Event type as "Click" and "Element or Tag Selector"  as  a and Please check the box to manually assign properties & attributes and then specify the attributes with their value. Please see the below snapshot for more help.

Thanks & Regards

Parit Mittal

2 Respostas

ParitMittal
ParitMittalResposta
Level 10
January 6, 2017

Hi Amin,

For your Use-case you can create  Create an Event based rule with Event type as "Click" and "Element or Tag Selector"  as  a and Please check the box to manually assign properties & attributes and then specify the attributes with their value. Please see the below snapshot for more help.

Thanks & Regards

Parit Mittal

AmaziAutor
Level 2
January 6, 2017

I used the above with regex and it worked. Thank you.