WordPress

How to Track Affiliate Clicks in WordPress Without a Plugin

By SK · runs 20+ affiliate sites·9 min read·Updated 2026-07-28

You don't need a plugin to track affiliate clicks in WordPress. Plugins add weight, updates, and one more thing that can break — and for click tracking, a free Google Analytics 4 setup does the job. Here's how to set it up three ways, and the honest limit you should understand before you rely on it.

Option 1: GA4 Enhanced Measurement (the free default)

If you already have GA4 on your WordPress site, you're partly done. GA4's Enhanced Measurement automatically records a click event whenever someone follows a link to an external domain — which is most affiliate links. Turn it on in Admin → Data Streams → your web stream → Enhanced Measurement, and make sure "Outbound clicks" is enabled.

Out of the box you'll see outbound clicks in your reports, with the destination URL as a parameter. It's zero-code and zero-plugin. The catch: every outbound link is lumped together, so you can't easily separate an affiliate click from a link to a source or a social profile without a little more work.

Option 2: Custom GA4 events (per-link detail)

To isolate affiliate clicks and attach the page they happened on, tag your affiliate links and fire a custom event. Add a data attribute to your affiliate links — for example data-aff="1" — then add a small script to your theme footer (via your theme's footer hook or a code snippet, no plugin needed) that listens for clicks on those links and sends a GA4 event with the destination and the current page. You end up with a clean affiliate_click event you can build reports and explorations around, segmented by page.

This is the sweet spot for most sites: free, lightweight, and granular enough to see which pages and which links drive your clicks.

Option 3: Google Tag Manager (no theme edits)

If you'd rather not touch theme files, Google Tag Manager does the same thing from a dashboard. Install the GTM container once, create a trigger that fires on clicks matching your affiliate links (by CSS selector or URL pattern), and attach a GA4 event tag. It's still plugin-free from WordPress's perspective — GTM lives in a snippet, not a plugin — and it's the easiest to maintain once set up.

The limit you must understand

All three methods do the same thing: they count clicks. And a click count is not an earnings figure.

What click-counting shows vs what it missesCounting clicks isn't measuring earningsGA4, no plugin — what you getOutbound clicks per pageClick-through rateTop affiliate linksTraffic source of the clickWhat it can't tell youWhich click actually earnedEPC and revenue per pageCommission tied to the pageConversion, not just the click
Free, plugin-free GA4 tracking counts clicks well — but a click count is not an earnings figure. To rank pages by EPC you have to join each click to the commission it produced, which click-counting alone can't do.

GA4 will happily tell you that a page sent 400 outbound clicks last month. It will not tell you that those 400 clicks earned $12 while another page's 90 clicks earned $140. Click-counting can't join a click to the commission it produced, so it can't give you EPC or revenue per page — and EPC is the number that actually ranks your content by profitability.

This matters because the highest-clicked page is routinely not the highest-earning one. Optimising for clicks can quietly push you toward cheap traffic. To see which pages earn, you need tracking that ties each click back to network revenue — the first-party, cookieless approach the rest of this library covers. GA4 without a plugin is a fine, free first step; just know its ceiling.

A sensible setup

For most WordPress affiliate sites: turn on Enhanced Measurement for a baseline, add a custom affiliate_click event (via a footer snippet or GTM) for per-page detail, and treat the numbers as click behaviour, not income. When you're ready to optimise for earnings rather than clicks, layer EPC tracking on top — that's the step that turns a click report into a profit-and-loss for your content.

From clicks to earnings: Clickolytics ties every affiliate click to the revenue it produced, so you get EPC and income per page — the part GA4 can't measure. See how it works →

Frequently asked questions

Can I track affiliate clicks without a plugin? Yes — GA4 tracks outbound clicks automatically via Enhanced Measurement, and you can add per-link detail with a custom event or Google Tag Manager. No WordPress plugin required.

How do I track outbound links in GA4? Enable Enhanced Measurement's outbound-clicks setting, then tag affiliate links with a data attribute and fire a custom affiliate_click event (gtag or GTM) that records the destination and page.

What's the downside? It counts clicks, not earnings. GA4 can't tie a click to its commission, so it can't give you EPC or revenue per page — the metric that ranks content by profitability.

Is a plugin worth it? For cloaking and link management, maybe — but plugins usually count clicks too. The ceiling is the same everywhere: clicks aren't commissions.

Related reading