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.

Hi,
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.

:frowning:

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>
<script>
$(".phoneLink").on("click", function () {
    _paq.push(['trackEvent', 'contact', 'clicked phone number', ]);
});
</script>

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 .

Update:

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]);
});

Hello,

sorry to warm up this old thread.
I have implemented the JS code (no jQuery) and seems to work only on Android phones. iPhones (Safari default settings) don’t get tracked if I call on a tel-link.

Any idea?

I track these clicks the same as other clicks with an onclick="_paq.push([‘trackEvent’, ‘Contact’, ‘Click’, ‘Click to Call’]);"

I just tested on my phone with Firefox browser on Android and it was tracking properly so I don’t believe that you need to add any additional code to get it to track.