Tracking Parameters

URL parameters for affiliate link tracking

Table of Contents

Tracking Parameters

AffiliateBase recognizes several URL parameters for affiliate tracking. This guide covers supported parameters, how they work, and best practices for using them.

Supported Parameters

All these parameters work identically:

ParameterExample
via?via=affiliate-token
ref?ref=affiliate-token
affiliate?affiliate=affiliate-token
a?a=affiliate-token

Use whichever fits your preference or URL structure.

How Parameters Work

Basic Usage

Append to any URL on your site:

https://yoursite.com?via=john
https://yoursite.com/pricing?via=john
https://yoursite.com/features?via=john&utm_source=twitter

Parameter Processing

When a visitor lands with a tracking parameter:

  1. Script detects the parameter
  2. Validates the affiliate token
  3. Creates/updates referral record
  4. Stores tracking cookies
  5. Removes parameter from URL (optional)

Token Validation

The token must match an active affiliate. Invalid tokens are ignored:

  • Non-existent tokens → No tracking
  • Disabled affiliate tokens → No tracking
  • Valid tokens → Referral created

URL Structure Examples

https://yoursite.com?via=john
https://yoursite.com/pricing?via=john
https://yoursite.com/blog/post-title?via=john

Tracking parameters work alongside others:

https://yoursite.com?via=john&utm_source=twitter&utm_medium=social
https://yoursite.com?plan=pro&via=john

Clean URLs

Some affiliates prefer cleaner URLs:

https://yoursite.com/go/john  (requires server-side redirect)

Parameter Priority

If multiple tracking parameters exist, the first one found is used:

?via=john&ref=sarah → "john" is used

Parameter check order:

  1. via
  2. ref
  3. affiliate
  4. a

Special Parameters

Referral Preloading

Load an existing referral without creating new tracking:

?referral=existing-referral-uuid

Use case: Return visitors from email links where you’ve stored their referral ID.

Custom Parameters

Requesting Custom Parameters

If you need a custom parameter for your use case, contact support. Common requests:

  • Brand-specific parameters
  • Legacy system compatibility
  • Integration requirements

For Affiliates

Affiliates can create links to any page:

Main site: https://yoursite.com?via=TOKEN
Pricing:   https://yoursite.com/pricing?via=TOKEN
Features:  https://yoursite.com/features?via=TOKEN
Blog:      https://yoursite.com/blog?via=TOKEN

Best Practices for Affiliates

  1. Link to relevant pages - Don’t always link to homepage
  2. Use descriptive anchors - “Start free trial” vs “Click here”
  3. Test links first - Verify tracking works
  4. Keep URLs clean - Avoid unnecessary parameters

Using Shorteners

Affiliate links can be shortened:

Original: https://yoursite.com/pricing?via=john
Shortened: https://bit.ly/xyz123

Important: The shortener must pass through parameters. Test before widespread use.

  • Bitly (works well)
  • Rebrandly (works well)
  • TinyURL (works well)
  • Custom domains (recommended for professionals)

Shortener Warnings

Some shorteners strip query parameters. Always test your shortened link to ensure the via parameter arrives at your site.

QR Codes

Creating QR Codes

Generate QR codes for offline promotion:

Encode: https://yoursite.com?via=john

When scanned, visitor lands on your site with tracking active.

QR Code Use Cases

  • Business cards
  • Print materials
  • Product packaging
  • Event displays
  • Physical stores

Deep Linking

Product Pages

Link directly to specific products:

https://yoursite.com/products/widget?via=john

Checkout Pages

Link to checkout with product selected:

https://yoursite.com/checkout?product=pro&via=john

Campaign Landing Pages

Create dedicated pages for campaigns:

https://yoursite.com/special-offer?via=john

Parameter Conflicts

With Existing Parameters

If your site uses ref for other purposes:

// This might conflict
?ref=internal-reference&via=john

// Better: use different parameters
?internal_ref=xyz&via=john

Solving Conflicts

  1. Use a different AffiliateBase parameter
  2. Rename your internal parameter
  3. Contact support for custom parameter

Testing Parameters

Verify Tracking Works

  1. Open your site with ?via=test-token
  2. Open browser console
  3. Check window.affiliatebase_referral
  4. Should contain the referral ID

Test Different Scenarios

  • Homepage with parameter
  • Deep page with parameter
  • Parameter with other query strings
  • Parameter after page load (SPA navigation)

Troubleshooting

Parameter Not Tracked

  1. Verify parameter spelling
  2. Check affiliate token is valid
  3. Ensure tracking script is loaded
  4. Look for console errors

Parameter Stripped

Some systems strip unknown parameters:

  • CDNs/caching layers
  • Redirect services
  • CMS configurations

Solution: Check your infrastructure or use a different parameter.

Next Steps