Tracking tel: URLs (phone numbers)

I usually put phone ## on a site so that people can click them and go right to dialer on smart phones. I uses tel:// instead of http:// to do it.

Is there a way to track the clicks on that link as a goal? I tried to track it as goal using tel://the# but doesnt seem to work with exact match or ‘contains’? Or maybe an easier/better way?

Thanks for help!

Tom g

1 Like

Does anyone know if this is possible to track a phone # link as tel:// ? I tried every combo of ‘goal’ but it wont see the click! I tried as url, contains, and expression.

tel: and mailto: URLs are ignored by Piwik (see Piwik.js: handle clickable phone number 'tel:' · Issue #9865 · piwik/piwik · GitHub)

One way to track them would be using CoustomDimensions: Reporting of mailto: clicks · Issue #9576 · piwik/piwik · GitHub

OMG! Thanks so much. I was thinking that maybe is ignored the tel:// but could find nothing to back up my assumption until now. I will def look into the custom dim plugin. :slight_smile:

Thanks again, Tom G. @ GiveSuccess

I was so glad to find a new way to try but i was not able to figure out what to enter to get it to work. Every way i tried failed to track it. There are few options to set but no matter how/what i set it to it failed to work so I am back to sq 1. The instructions are not too clear to me.


Thanks for helping still.

Tom g

Hi, you made me curious and I just tried to implement it on my own site:

This is a minimal working example, I hope you get the idea how to implement it yourself I added a javascript handler, which execute the piwik trackEvent function.

<a href="tel:+123456789" class="phoneLink">Call me</a>
$(".phoneLink").on("click", function () {
    _paq.push(['trackEvent', 'contact', 'clicked phone number', ]);

Of course you can also write it in plain javascript without jQuery.

This tracks all clicks on the phone number as events, for more sophisticated statistics (which phone numbers get clicked most often, usw.) you’ll need to use CustomDimensions .


a bit more sophisticated example:

$("a[href^='tel:']").on("click", function (e) {
    _paq.push(['trackEvent', 'contactform', 'called', this.href]);

And while we are on it we an use the same concept to track mailto: links:

$("a[href^='mailto:']").on("click", function (e) {
    _paq.push(['trackEvent', 'contactform', 'mail sent', this.href]);

If you are not using jQuery: (thanks to @Patrice)

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