Hey 👋 new reader,
Pluralsight gave me some free1 month
, get them before
subscriptions
they are gone!
Track mailto and tel clicks in Wordpress with Google Analytics
10 Nov 2017 · 1 min read Edit PostIt is useful to track when vistors interact with telephone and email links. With this Wordpress Plugin you can easily track how many times people click on these in just 1 minute.
Download a Wordpress Plugin
I created a Wordpress plugin to simply go through all the mailto
and tel
<a>
elements on the page and add the Google Analytics tracking code to onclick
.
- Download Wordpress Plugin to Track tel and mailto links.
- Add it to your site and enable the plugin
Before:
<a href="mailto:[email protected]">Contact me</a>
After:
<a onclick="ga('send','event','Mailto Tracking: [email protected]','Click/Touch');" href="mailto:[email protected]">Contact me</a>
The plugin sends back to Google:
ga(
'send',
'event',
'Mailto Tracking: [email protected]',
'Click/Touch'
);
For tel links, it is the same.
Before:
<a href="tel:+0759606141">Bristol 0759606141</a>
After:
<a onclick="ga('send','event','Phone Call Tracking: 0759606141','Click/Touch');" href="tel:+0759606141">Bristol 0759606141</a>
The plugin sends:
ga(
'send',
'event',
'Phone Call Tracking: 0759606141',
'Click/Touch'
);
Open Source
I built the plugin and made it open source. Please request a new feature or improve it here.
Add the Wordpress plugin to your site to track mailto and tel presses!
Suggested
- 1.1 Million SLOC — 28 October 2017
- The First Website I Built — 15 November 2017