Affiliate Links

Create branded short-link redirects with automatic click tracking — no third-party URL shortener needed.

TL;DR

Go to Admin → Affiliates. Create a link with a name, slug, and destination URL. Share yourdomain.com/go/slug. Clicks are tracked automatically and viewable from the link's detail page.

Details

Creating an Affiliate Link

Each affiliate link has three fields:

  • Name — an internal label to help you identify the link (not shown publicly).
  • Slug — the URL-safe keyword used in the short link (/go/your-slug). Must be unique. Use lowercase letters, numbers, and hyphens only.
  • Destination URL — the full URL the link redirects to (e.g., https://partner.com/?ref=pubvana).

After saving, the short link is immediately active at yourdomain.com/go/your-slug.

How Redirects Work

When a visitor hits /go/your-slug, the AffiliateRedirect controller:

  1. Looks up the slug in the affiliate_links table.
  2. Logs the click: IP address is hashed with SHA-256 (never stored in plain text), referrer domain is stored.
  3. Issues a 301 Permanent Redirect to the destination URL.

If the slug is not found or the link is inactive, the visitor is sent to your site's home page.

Click Tracking

Admin → Affiliates lists all your links with a total click count column. Click the link name or the "Stats" button to open the detail view, which shows:

  • Total clicks (all time)
  • Clicks per day (last 30 days)
  • Individual click log: timestamp, hashed IP, referrer domain

Active / Inactive Toggle

Each link can be toggled active or inactive without deleting it. Inactive links redirect to the home page instead of the destination.

Use Cases

  • Partner/sponsor links — share yourdomain.com/go/sponsor in posts and newsletters; track clicks without exposing the raw affiliate URL.
  • Podcast/print mentions — short branded URLs are easy to speak aloud or typeset.
  • Social media traffic — create one link per social platform to compare traffic sources.
  • A/B destination testing — swap the destination URL on an existing slug to redirect traffic without breaking shared links.