javascript - Goggle Tag Manager not working on link clicks -


i facing weird issue in google tag manager not able track links below markup

<a onclick="javascript:some_method(event, url, 'param')">test</a> 

wherever, in code kind of markup, link tracking not working.

is there special need track links javascript: notation?

trigger looks below:

enter image description here

tag looks below:

enter image description here

any assistance please?

you have problem trigger condition. click classes - matches css selector - .last-td a not work

because click classes variable contains string value of class attribute dom element.

you have 2 different ways solve problem:

1) need add class a link. example: <a onclick="javascript:some_method(event, url, 'param')" class="this-is-my-last-td-link">test</a>

then condition work: click classes - equals - this-is-my-last-td-link

2) can change condition click element - matches css selector - .last-td a without changing markup

update

based on discussion in chat. function has e.stoppropagation() inside. need change e.preventdefault()


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -