How to Track Affiliate Links with Plausible Analytics

⚡ QUICK VERDICT

A working affiliate click tracking setup with clean event data in your Plausible dashboard.

See Top Pick →

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.

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:

  1. Go to plausible.io and log in
  2. Select your site from the dashboard
  3. Click Settings → JavaScript Scripts
  4. 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:

  1. Go to your Plausible dashboard
  2. Click Analytics → Events
  3. Look for “Affiliate Click” in the event list
  4. 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:

  1. Go to Settings → Goals
  2. Click Add goal
  3. Choose Custom event
  4. Enter Affiliate Click as the event name
  5. Save

Now you can see:

  • Conversion rate per page
  • Total affiliate clicks
  • Trend over time

Understanding Your Data

What Plausible Shows You

MetricWhat It Means
Total Affiliate ClicksHow many times visitors clicked any tracked affiliate link
Unique ClicksUnique visitors who clicked (approximated)
Top PagesWhich content drives the most affiliate interest
Click RateClicks ÷ 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

ToolFree TierPaid TierBest For
Plausible30-day trial€9/mo (10K visits)Privacy-first analytics
Google AnalyticsFree (GA4)FreeFull-featured, requires consent
Simple Analytics14-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.

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.

Yes. Add additional plausible('Outbound Click') events for any link you want to track.

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.

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:

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

  1. Which pages have highest click-through rate?

    • CTR = Affiliate Clicks ÷ Page Views
    • Pages with high CTR deserve more affiliate links
  2. Which programs get the most interest?

    • Compare click distribution across programs
    • Consider adding more links for popular programs
  3. 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/MonthInterpretationAction
0-10Getting startedTest different link placements
10-50Building momentumDouble down on top pages
50-200Solid performanceOptimize for higher conversion
200+High performerConsider 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

Script Slowing Down Your Site

The script is lightweight (<1KB), but if you notice issues:

  • Load it asynchronously: add async to the main Plausible script
  • Place it at the bottom of the page

Related tutorials:

Related best-of lists: