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:
| Parameter | Example |
|---|---|
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:
- Script detects the parameter
- Validates the affiliate token
- Creates/updates referral record
- Stores tracking cookies
- 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
Simple Links
https://yoursite.com?via=john
Links with Paths
https://yoursite.com/pricing?via=john
https://yoursite.com/blog/post-title?via=john
Links with Other Parameters
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:
viarefaffiliatea
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
Creating Links
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
- Link to relevant pages - Don’t always link to homepage
- Use descriptive anchors - “Start free trial” vs “Click here”
- Test links first - Verify tracking works
- Keep URLs clean - Avoid unnecessary parameters
Link Shorteners
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.
Recommended Shorteners
- 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
- Use a different AffiliateBase parameter
- Rename your internal parameter
- Contact support for custom parameter
Testing Parameters
Verify Tracking Works
- Open your site with
?via=test-token - Open browser console
- Check
window.affiliatebase_referral - 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
- Verify parameter spelling
- Check affiliate token is valid
- Ensure tracking script is loaded
- 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
- Learn about attribution windows
- Understand how attribution works
- Set up cross-domain tracking