A simple shortcode to insert Google Analytics event tracking code on your links
As of April 2026, Track a click on Google Analytics is a WordPress Link Click plugin with 10 active installations and a 5/5 rating from 1 reviews. It has been downloaded 2.0K+ times in total. Requires WordPress 2.5.0+ and PHP false+. Available on WordPress.org since 2016. Last updated 9 years ago — may have compatibility concerns.
Are you using UTM Source to track link clicks within your website?
That’s a really bad idea! Not only will it create a new session with the links utm_source and inflate your visitor stats, it will also increase the bounce rate on the page you’re tracking.
So what’s the solution?
Use [event tracking] (https://developers.google.com/analytics/devguides/collection/analyticsjs/events) on Google Analytics which capture events like a link click into your Google Analytics Dashboard.
For e.g.
Download Free Ebook
But then the WordPress Visual Editor will keep cleaning out the onClick part, so we made a quick shortcode that would save you from the trouble of redoing the onClick part everytime it got cleaned out.
How does it work?
In place of an A href tag like <a onClick="ga…
| WordPress | 2.5.0+ requiredTested up to 4.6.30 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.