Disclosure: This article includes affiliate references. If you buy through certain links, we may earn a commission at no extra cost to you. Our recommendations remain independent.
Plausible Analytics provides the simplest way to track affiliate link clicks without violating visitor privacy. This tutorial walks you through setting up event tracking for affiliate links in under 30 minutes—no coding required beyond copying a snippet.
If you monetize your site through affiliate programs (Amazon, ConvertKit, tools you recommend), you need to know which links actually generate revenue. Plausible’s event tracking gives you clean, actionable data.
Related Articles
Why Track Affiliate Links
Affiliate marketing works best when you know what’s working:
- Click data tells you which CTAs attract attention
- Conversion rates reveal actual earnings potential
- You spot underperforming links and optimize them
- Privacy-compliant (unlike third-party affiliate networks)
Plausible stores all data on your own domain—no third-party cookies, no GDPR consent banners needed for most use cases.
What You’ll Need
- A Plausible account (€9/mo for 10K visits)
- WordPress, Webflow, or any site where you can add a script
- Affiliate links you want to track
Step 1: Get Your Plausible Event Script
Plausible provides a custom script for each site:
- Go to plausible.io and log in
- Select your site from the dashboard
- Click Settings → JavaScript Scripts
- Copy the script that looks like:
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
This is your base analytics script. If you’ve already installed it, skip to Step 2.
Step 2: Add Event Tracking for Affiliate Clicks
Plausible tracks custom events through the plausible function. Add this to your site (ideally in your footer, before </body>):
<script>
// Track all clicks on affiliate links
document.addEventListener('DOMContentLoaded', function() {
var affiliateLinks = document.querySelectorAll('a[href*="amazon.com"]');
affiliateLinks.forEach(function(link) {
link.addEventListener('click', function() {
plausible('Affiliate Click', {
props: {
url: window.location.href,
link: link.href
}
});
});
});
});
</script>
This script:
- Listens for clicks on any link containing “amazon.com”
- Fires a custom event called “Affiliate Click” to Plausible
- Passes the page URL and clicked link as properties
Step 3: Track Multiple Affiliate Programs
Different programs use different domains. Expand the script to track multiple:
<script>
document.addEventListener('DOMContentLoaded', function() {
// Define affiliate programs to track
var affiliateDomains = [
'amazon.com',
'shareasale.com',
'convertkit.com',
'getresponse.com',
'teachable.com'
];
// Track clicks on any matching affiliate link
document.querySelectorAll('a[href]').forEach(function(link) {
var href = link.href.toLowerCase();
if (affiliateDomains.some(function(domain) {
return href.includes(domain);
})) {
link.addEventListener('click', function() {
// Extract the program name from the URL
var program = affiliateDomains.find(function(d) {
return href.includes(d);
});
plausible('Affiliate Click', {
props: {
program: program,
page: window.location.pathname,
link_text: link.innerText.trim().substring(0, 50)
}
});
});
}
});
});
</script>
This version:
- Tracks any link containing your affiliate program domains
- Extracts the program name automatically
- Captures which page the click came from
- Records the link text (useful for A/B testing CTAs)
Step 4: Verify Events in Plausible Dashboard
After setting up the script and clicking a few affiliate links yourself:
- Go to your Plausible dashboard
- Click Analytics → Events
- Look for “Affiliate Click” in the event list
- Click on it to see:
- Top pages where clicks happen
- Breakdown by program (if you added the program property)
- Click volume over time
You should see data within 5-10 minutes of the first test click.
Step 5: Set Up Goals for Conversion Tracking
For deeper insights, create a goal in Plausible:
- Go to Settings → Goals
- Click Add goal
- Choose Custom event
- Enter
Affiliate Clickas the event name - Save
Now you can see:
- Conversion rate per page
- Total affiliate clicks
- Trend over time
Understanding Your Data
What Plausible Shows You
| Metric | What It Means |
|---|---|
| Total Affiliate Clicks | How many times visitors clicked any tracked affiliate link |
| Unique Clicks | Unique visitors who clicked (approximated) |
| Top Pages | Which content drives the most affiliate interest |
| Click Rate | Clicks ÷ total page views = conversion % |
What Plausible Can’t Tell You
- Actual conversions — Plausible tracks clicks, not sales
- Revenue — connect to affiliate network dashboards for earnings
- User identity — no cookies means no cross-session tracking
Best practice: Track clicks in Plausible, track sales in your affiliate network’s dashboard. Compare the two to calculate conversion rates.
Tools & Pricing
| Tool | Free Tier | Paid Tier | Best For |
|---|---|---|---|
| Plausible | 30-day trial | €9/mo (10K visits) | Privacy-first analytics |
| Google Analytics | Free (GA4) | Free | Full-featured, requires consent |
| Simple Analytics | 14-day trial | €9/mo (10K visits) | Plausible alternative |
| Fathom | $19/mo | $19/mo (10K visits) | Privacy-focused, simpler |
Recommendation: Plausible at €9/mo works for most solo sites. If you’re under 10K monthly visits, the paid plan is cost-effective.
Who Should Use This
Do this if:
- You recommend tools/products and earn affiliate commissions
- You want simple, privacy-compliant click tracking
- You’re tired of GDPR consent popups from other analytics
- You need to prove affiliate performance to yourself or clients
Skip this if:
- You don’t monetize through affiliates
- You need revenue-level conversion data (use network dashboards)
- You need cross-session user tracking
Common Mistakes
Mistake 1: Only Tracking Clicks, Not Testing
Track clicks but never test different CTAs. Use A/B variations to find what works.
Mistake 2: Tracking Too Many Links
Start with your top 3-5 affiliate programs. Add more only if you can act on the data.
Mistake 3: Not Filtering Bot Traffic
Plausible filters some bots automatically, but check your data periodically for anomalies.
Mistake 4: Ignoring the Affiliate Network Data
Plausible shows clicks. Your affiliate network shows actual sales. Both matter.
FAQ
Does Plausible work with WordPress?
Yes. Add the script to your theme’s footer.php or use a plugin like “Insert Headers and Footers.”
Can I track which product was clicked?
Yes. Add a product property in your event props:
props: {
program: 'convertkit',
product: 'creator-plan'
}
Is this GDPR compliant?
Plausible is designed for privacy compliance. It doesn’t use cookies and doesn’t track personal data. Most EU sites don’t need a consent banner.
What’s the minimum traffic to benefit from tracking?
Even with 100 monthly visitors, knowing which links get clicked helps you optimize. The value increases with traffic.
Can I track outbound links to non-affiliate destinations?
Yes. Add additional plausible('Outbound Click') events for any link you want to track.
How do I track clicks on links that open in new tabs?
Add target="_blank" links to your selector. The click event fires before the navigation, so it works the same.
Can I use this with Google Tag Manager?
Yes. Create a custom HTML tag in GTM that contains the event tracking script. Fire it on all pages.
What’s the difference between Plausible and GA4 for affiliate tracking?
GA4 requires consent banners in Europe. Plausible doesn’t. GA4 has more features but steeper learning curve. For affiliate clicks specifically, Plausible gives you cleaner data faster.
How do I know if my tracking is working?
Open your site in incognito mode, click an affiliate link, wait 5 minutes, then check your Plausible Events dashboard. You should see the click.
Can I track clicks on button elements, not just anchor tags?
Yes. Change document.querySelectorAll('a[href]') to include buttons:
document.querySelectorAll('a[href], button[data-affiliate]')
Then add data-affiliate="product-name" to your buttons.
Do I need to disclose affiliate link tracking?
Your site should have a general affiliate disclosure in your footer or privacy policy. The specific event tracking doesn’t need separate disclosure—it’s anonymized just like regular analytics.
WordPress-Specific Setup
If you’re using WordPress, you have three options for adding the tracking script:
Option 1: Theme Functions (Recommended)
Add to your theme’s functions.php:
function plausible_affiliate_tracking() {
?>
<script>
// Paste the affiliate tracking script here
</script>
<?php
}
add_action('wp_footer', 'plausible_affiliate_tracking');
Option 2: Plugin
Use “WPCode” or “Insert Headers and Footers” plugin. Add the script in the Footer section.
Option 3: Cookiebot
If you already use Cookiebot for GDPR compliance, add the Plausible script to your cookie consent. Plausible itself doesn’t require consent, but this keeps your analytics consistent.
Analyzing Your Affiliate Data
Once you have data, here’s how to extract actionable insights:
Monthly Review Checklist
-
Which pages have highest click-through rate?
- CTR = Affiliate Clicks ÷ Page Views
- Pages with high CTR deserve more affiliate links
-
Which programs get the most interest?
- Compare click distribution across programs
- Consider adding more links for popular programs
-
Are clicks converting to sales?
- Pull sales data from affiliate networks
- Calculate conversion rate: Sales ÷ Clicks
- Low conversion = weak offer or wrong audience
Performance Tiers
| Clicks/Month | Interpretation | Action |
|---|---|---|
| 0-10 | Getting started | Test different link placements |
| 10-50 | Building momentum | Double down on top pages |
| 50-200 | Solid performance | Optimize for higher conversion |
| 200+ | High performer | Consider scaling content in this niche |
Troubleshooting
Events Not Showing Up
- Check script for errors — Open browser console (F12) before clicking
- Verify domain matches — Data-domain in script must match exactly
- Wait 10+ minutes — Plausible can take time to process events
- Check filter settings — Ensure you’re not filtering your own IP
Too Many False Positives
If you’re seeing clicks that aren’t real:
- Add a delay:
setTimeout(function() { ... }, 500) - This prevents tracking on page load or scroll-triggered clicks
Related Comparisons
Script Slowing Down Your Site
The script is lightweight (<1KB), but if you notice issues:
- Load it asynchronously: add
asyncto the main Plausible script - Place it at the bottom of the page
Related tutorials:
Related best-of lists: