Affiliate Tracking Script
This script automatically detects affiliate referral parameters in URLs and sets tracking cookies on the edenware.app domain.
Basic Usage
Add this script to your website's <head> section:
<script src="https://edenware.app/hub/affiliate-tracker.js"></script>
Copy Code
How It Works
URL Detection: The script automatically checks for referral parameters like ?ref=3 (WordPress affiliate ID), ?ref=ABC123, ?wpam_id=3, ?affiliate_ref=ABC123, or ?aff=ABC123
Cookie Setting: Sets a cookie named affiliate_ref on the .edenware.app domain (global tracking)
Cross-Domain: Works on any domain that embeds the script
Advanced Configuration
You can customize the script behavior by setting configuration before loading (add appId to report click analytics per app):
<script>
window.EdenwareAffiliateConfig = {
baseUrl: 'https://edenware.app/hub',
cookieDomain: '.edenware.app',
paramNames: ['ref', 'affiliate_ref', 'aff', 'wpam_id'],
appId: 'snapcover',
debug: false
};
</script>
<script src="https://edenware.app/hub/affiliate-tracker.js"></script>
Configuration Options
Option
Description
Default
baseUrl
Edenware API base URL
'https://edenware.app/hub'
cookieDomain
Cookie domain for tracking
'.edenware.app'
paramNames
URL parameter names to check
['ref', 'affiliate_ref', 'aff', 'wpam_id']
appId
App to attribute clicks to (for analytics)
null
debug
Enable debug logging
false
Payment Buttons Script
This script creates payment buttons that automatically include affiliate tracking information.
Basic Usage
Add the script and create payment buttons:
<script src="https://edenware.app/hub/payment-tracker.js"></script>
<!-- PayPal Button -->
<div class="edenware-payment-button"
data-app="your-app-id"
data-price="29.90"
data-currency="BRL">
Buy Premium License
</div>
<!-- Multiple payment methods -->
<div class="edenware-payment-button"
data-app="megacubo"
data-price="49.90"
data-currency="BRL"
data-method="both">
Buy Megacubo Premium
</div>
Copy Code
Payment Button Parameters
Attribute
Description
Required
Default
data-app
App identifier (see available apps in hub)
No
'' (auto-detect)
data-price
Product price
No
'29.90'
data-currency
Currency code (BRL, USD, EUR)
No
'BRL'
data-method
Payment methods (paypal, mercadopago, both)
No
'paypal'
Advanced Configuration
<script>
window.EdenwarePaymentConfig = {
baseUrl: 'https://edenware.app/hub',
debug: false
};
</script>
<script src="https://edenware.app/hub/payment-tracker.js"></script>
Integration Examples
Complete Website Integration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Download Site</title>
<!-- Edenware Affiliate Tracking -->
<script src="https://edenware.app/hub/affiliate-tracker.js"></script>
<!-- Edenware Payment Buttons -->
<script src="https://edenware.app/hub/payment-tracker.js"></script>
</head>
<body>
<h1>Download Your App</h1>
<!-- Payment Button -->
<div class="edenware-payment-button"
data-app="your-app-id"
data-price="29.90"
data-currency="BRL">
Buy Premium License - $29.90
</div>
<p>Your affiliate link: https://my-site.com/download?ref=YOUR_REF_CODE</p>
</body>
</html>
WordPress Integration
<!-- Add to your theme's header.php or use a plugin -->
<script src="https://edenware.app/hub/affiliate-tracker.js"></script>
<script src="https://edenware.app/hub/payment-tracker.js"></script>
<!-- Use in posts/pages -->
<div class="edenware-payment-button"
data-app="your-app-id"
data-price="29.90"
data-currency="USD">
Buy Now
</div>
Testing
Test URLs
Test the tracking by visiting URLs with referral parameters:
https://your-site.com/download?ref=ABC123
https://your-site.com/download?affiliate_ref=XYZ789
https://your-site.com/download?aff=DEF456
Debug Mode
Enable debug logging to see tracking activity:
<script>
window.EdenwareAffiliateConfig = {
debug: true
};
</script>
<script src="https://edenware.app/hub/affiliate-tracker.js"></script>
Note: Debug mode should only be used during development. Disable it in production to avoid console spam.
Support & FAQ
Frequently Asked Questions
How do I get my referral code?
Log into your affiliate dashboard at edenware.app/hub/dashboard to find your unique referral code.
Can I use custom parameter names?
Yes, configure the paramNames array in window.EdenwareAffiliateConfig.
Do the scripts work on HTTPS sites?
Yes, the scripts work on both HTTP and HTTPS sites.
Can I track multiple referrals?
The script only tracks the first valid referral found. Existing cookies are not overwritten.
Need Help?
Contact our affiliate support team for integration assistance.