Phone tracking doesn't work

Hi everyone,
This is Ellie, i’ve checked the forums same problem, but seems there isnt any solution, we also tried tag manager, doesnt seem working.
so here is the questions :

We are using wordpress for our websites
we dont know whether to use jQuery or not , assume that we don’t use it .
Is it that we just add Javascript code into Google tag manager ?
and the code would be as below,

document.querySelector(“a[href^=‘tel:’]”).addEventListener(‘click’, function (e) {
_paq.push([‘trackEvent’, ‘contact’, ‘called this phone number’, this.href]);
});

if anyone can help, it would be great.
i also inserted a screenshot, perhaps u 'll know better what i meant.
Hope to hear from anyone soon,

Thanks in advance.
Best regards

Ellie

Hi @ellie1
The problem in your code is that you’ll get only the first tel link.
You should use document.querySelectorAll(…) instead, but the function return is an array of nodes instead of a single node…