NOVA Affiliate Pro uses a two-step tracking system:
Place this code in the <head> section of every page on your website. This tracks when visitors arrive via affiliate links.
Where to place it: In your website's main template/layout file (header.php, index.html, or theme header).
<!-- NOVA Affiliate Pro Tracking Pixel -->
<script>
(function() {
// Extract affiliate code from URL (?ref=XXX)
const urlParams = new URLSearchParams(window.location.search);
const affCode = urlParams.get('ref');
if (affCode) {
// Store in localStorage for future conversions
localStorage.setItem('nova_aff_ref', affCode);
// Track click immediately
fetch('https://novaaffiliatepro.com/api/trackClick', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
affiliate_code: affCode,
offer_id: 'YOUR_OFFER_ID', // Get this from your merchant dashboard
landing_page: window.location.href,
referrer: document.referrer
})
});
}
})();
</script>Place this code on your thank-you / order confirmation page (the page shown AFTER a successful purchase):
Important: Replace YOUR_OFFER_ID with the actual offer ID from your dashboard. Replace order details with dynamic values from your checkout system.
<!-- Conversion Tracking - Place on Thank You / Success Page -->
<script>
(function() {
const affCode = localStorage.getItem('nova_aff_ref');
if (affCode) {
// Send conversion event
fetch('https://novaaffiliatepro.com/api/recordConversion', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
affiliate_code: affCode,
offer_id: 'YOUR_OFFER_ID', // Get this from your merchant dashboard
order_id: 'ORDER-12345', // Replace with actual order ID from your system
sale_amount: 99.99, // Replace with actual sale amount
customer_email: 'customer@example.com' // Optional: customer email
})
}).then(() => {
// Clear affiliate cookie after conversion
localStorage.removeItem('nova_aff_ref');
});
}
})();
</script>https://novaaffiliatepro.com?ref=TEST in URL, complete a purchase, check Admin Dashboard → Trackingorder_id and sale_amount come from your checkout system (not hardcoded)For server-side integration, you can send conversion data directly from your backend:
// Server-Side Integration Example (Node.js / Express)
// Use this when you want to track conversions from your backend
app.post('/order/complete', async (req, res) => {
const { order_id, total_amount, customer_email } = req.body;
// Get affiliate code from session/cookie (set when user clicked affiliate link)
const affiliate_code = req.session.affiliate_ref;
if (affiliate_code) {
// Send conversion to NOVA Affiliate Pro
await fetch('https://novaaffiliatepro.com/api/recordConversion', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
affiliate_code: affiliate_code,
offer_id: 'YOUR_OFFER_ID', // From merchant dashboard
order_id: order_id,
sale_amount: total_amount,
customer_email: customer_email
})
});
// Clear affiliate reference after conversion
delete req.session.affiliate_ref;
}
res.json({ success: true });
});
// Store affiliate code when user arrives via affiliate link
app.get('/product/:id', (req, res) => {
const ref = req.query.ref;
if (ref) {
req.session.affiliate_ref = ref;
}
// ... render product page
});Affiliates will share links in this format:
https://yourwebsite.com/product?ref=AFFILIATE_CODEWhere AFFILIATE_CODE is the unique code assigned to each affiliate.
To verify everything works correctly:
?ref=TEST_CODE