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:
tag looks below:
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
Post a Comment