Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/statsdroneadmin/thirstyaffiliates-dynamic-variables/archive/refs/heads/main.zipConverts ThirstyAffiliates links into dynamic tracking URLs with unique click IDs based on selected affiliate program software.
Description
This WordPress plugin automatically appends a unique click ID parameter to outbound ThirstyAffiliates links, customized per affiliate software. This is essential for tracking conversions, managing attribution, and improving analytics for affiliate campaigns.
Supported affiliate platforms include: Cellxpert, ReferOn, Income Access, MyAffiliates, Affise, Smartico, Post Affiliate Pro, and many more.
Features
- Injects a unique
clickidbased on selected affiliate software - Early interception of redirects for accurate attribution
- Full integration with ThirstyAffiliates plugin
- Admin metabox to select affiliate software per link
- Debug UI for testing and log inspection
- Fallback hook support via ThirstyAffiliates filters
- Cryptographically secure click ID generation
- Support for 25+ major affiliate platforms
How It Works
When a visitor clicks on a ThirstyAffiliates link, the plugin:
- Intercepts the request before WordPress handles redirection
- Looks up the configured affiliate software for that link
- Appends a unique click ID using the correct query parameter for the selected platform
- Redirects the user to the final URL with the appended click ID
If early interception fails, the plugin falls back to ThirstyAffiliates' native redirect filters.
Supported Affiliate Software
| Platform | Query Parameter |
|---|---|
| Cellxpert | afp1={clickid} |
| ReferOn | clickid={clickid} |
| Income Access | c={clickid} |
| MyAffiliates | payload={clickid} |
| MAP | cid={clickid} |
| Mexos | var1={clickid} |
| Raventrack | s1={clickid} |
| ComeOn / Omarsys | var={clickid} |
| FirstCasinoPartners | clickid={clickid} |
| Alanbase | sub_id1={clickid} |
| Smartico / TAP | afp={clickid} |
| PostAffiliatePro | s1={clickid} |
| Affelios | clickid={clickid} |
| Affise | sub1={clickid} |
| Realtime Gaming | subGid={clickid} |
| Quintessence | anid={clickid} |
| NetRefer | var1={clickid} |
| GoldenReels / PoshFriends / Superboss / Profit / Conquestador / Bons | promo={clickid} |
Installation
Prerequisites
- WordPress 5.0+
- ThirstyAffiliates plugin installed and active
- PHP 7.2+
Steps
- Download this plugin
- Upload to your
/wp-content/plugins/directory - Activate the plugin via the WordPress admin
- Edit a ThirstyAffiliates link and select the appropriate affiliate software from the "Affiliate Program Software" metabox
- Test your links using the debug UI (Settings > TADV Debug) to verify functionality
Usage
Setting Up a Link
- Create or edit a ThirstyAffiliates link as usual
- In the link editor sidebar, find the "Affiliate Program Software" metabox
- Select your affiliate partner's software from the dropdown
- Save the link
- Test the link to ensure proper tracking
Example
Before: Your affiliate link yourdomain.com/recommends/casino1 → https://casino.com/signup
After: Same link for visitors, but with tracking yourdomain.com/recommends/casino1 → https://casino.com/signup?clickid=x7k9m2n5p8
Debugging
Go to Settings > TADV Debug in the WordPress admin to:
- View system status and plugin compatibility
- Test predefined ThirstyAffiliates links
- Run configuration tests
- View configured links and their software settings
- View and clear the plugin log
Logging
The plugin writes logs to: wp-content/thirstyaffiliates-dv.log
Use this to trace redirect behavior, software mapping, and errors. Logging only occurs when WP_DEBUG is enabled.
Example Log Output
[2024-01-15 10:30:45] [INFO] Plugin v1.0.0 loaded [2024-01-15 10:31:12] [INFO] Found ThirstyAffiliates link ID 123 for slug: casino-offer [2024-01-15 10:31:12] [INFO] Processing link with software: cellxpert [2024-01-15 10:31:12] [INFO] Generated URL: https://casino.com/signup?afp1=x7k9m2n5p8 (Click ID: x7k9m2n5p8)
Security Features
- Cryptographically secure click ID generation using
random_bytes() - Proper nonce verification for admin forms
- Capability checks for administrative functions
- Input sanitization and validation
- SQL injection prevention through prepared statements
Compatibility
- WordPress: 5.0+
- PHP: 7.2+
- ThirstyAffiliates: All versions
- Tested up to: WordPress 6.4
Troubleshooting
Plugin Not Working?
- Ensure ThirstyAffiliates is active
- Check that you've selected software for your links
- Enable
WP_DEBUGand check the log file - Use the debug page to run configuration tests
Links Not Redirecting Properly?
- Check the debug log for error messages
- Verify the destination URL is valid
- Test with a simple link first
- Check for conflicting plugins
Changelog
v1.0.0
- Initial release
- Early hook-based redirect interception
- Admin UI for software selection
- Debug panel and log viewer
- Support for 25+ affiliate platforms
- Cryptographically secure click ID generation
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Support
For support and feature requests, please open an issue on GitHub or contact StatsDrone.
License
MIT License - see LICENSE file for details.
Author
StatsDrone - WordPress plugins and affiliate marketing tools.