Goal Tracking Not Working for Email and Phone Links (mailto: and tel:)

Hi Matomo Community,

I’m having trouble setting up goal tracking for email (mailto:) and phone (tel:) links on my website. Here’s what I’ve done so far:

  1. Set up goals in Matomo with the type “Manually trigger a conversion by calling the JavaScript method _paq.push(['trackGoal', ID]);.
  2. Added onclick events to the email and phone links, as per the example below:

  1. Verified that the Matomo tracking code is correctly installed and that matomo.php is accessible.

Issue:

  • Goal tracking for email and phone links is not working. Clicks on these links are not being recorded in Matomo, even though the onclick events are firing.
  • The WhatsApp link goal (external link) works perfectly.

What I’ve Tried:

  • Added return true; to the onclick events.
  • Tested in multiple browsers (Brave, Microsoft Edge, Firefox, Chrome).

Questions:

  1. Why are email and phone link goals not being tracked?
  2. Are there any additional steps or configurations required to track mailto: and tel: links in Matomo?
  3. How can I debug this issue further?

Any help would be greatly appreciated!

UPD: Mobile vs. Desktop Browser Discrepancy

After further testing, I’ve discovered that goal tracking for email (mailto:) and phone (tel:) links works perfectly on mobile browsers (tested on Chrome and Brave) but does not work on desktop browsers (tested on Brave, Edge, etc.). Here’s what I’ve observed:

  • Mobile Browsers:
    • Clicks on email and phone links are successfully tracked as goals in Matomo.
    • No errors in the browser console.
  • Desktop Browsers:
    • Clicks on email and phone links are not tracked as goals in Matomo.
    • No errors in the browser console, and the onclick events appear to fire correctly.

Screenshot for goal conversions working on Chrome browser from a mobile device:

Screenshot for Brave browser on a mobile device registering goals:

Would anyone happen to know why goal tracking works on mobile browsers but not on desktop browsers?

Thanks!

Hi @firefox_butterfly
Does it work on Windows? (I see your code capture was from Mac)
can you check if the sendbeacon has been activated?

In the page, do you track only with _paq (and not _mtm)?
Can you check the network console (to see if the Matomo tracking request is aborted by browser for example)?
On desktop, what happens if you console.log('click!'); instead of paq.push(['trackGoal', ID]);?

1 Like

Hi Philippe,

Thanks for your help! After further debugging, I found the issue—it was a mistake in my own code, unrelated to Matomo, JS, or browsers. Everything is fixed now and working perfectly on both mobile and desktop.

I appreciate your suggestions!