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:
- Set up goals in Matomo with the type “Manually trigger a conversion by calling the JavaScript method
_paq.push(['trackGoal', ID]);
”. - Added
onclick
events to the email and phone links, as per the example below:
- 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 theonclick
events. - Tested in multiple browsers (Brave, Microsoft Edge, Firefox, Chrome).
Questions:
- Why are email and phone link goals not being tracked?
- Are there any additional steps or configurations required to track
mailto:
andtel:
links in Matomo? - 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!