Tracking guide
PartnerLens tracks affiliate sales with one script on your site, plus server calls for renewals if you need them.
Shown in Vendor panel → Tracking setup.
Best for most web apps. Takes about 5 minutes.
Step 1 · Add the script to every page
Paste it inside <head>. It reads ?ref= from affiliate links and keeps it in a first-party cookie for your cookie window.
HTML
<script async src="https://mindtrekpartnerlens.com/pl.js" data-app="APP_KEY"></script>Step 2 · Report sign-ups and sales
Call these on your sign-up and checkout success pages. For recurring billing, also send renewals from your server to POST /v1/conversions.
JavaScript
// Once per page, before any call (lets calls run before the async script loads)
window.partnerlens = window.partnerlens || { q: [], signup(d) { this.q.push(['signup', d]); }, install(d) { this.q.push(['install', d]); }, sale(d) { this.q.push(['sale', d]); } };
// After a customer signs up
partnerlens.signup({ email: 'customer@example.com', name: 'Jane Doe' });
// After a store installs your app (ends the affiliate journey)
partnerlens.install({ shop: 'store.myshopify.com', email: 'owner@store.com', name: 'Jane Doe' });
// After a payment succeeds (amount in cents, USD)
partnerlens.sale({ orderId: 'INV-1042', amount: 4900, currency: 'USD' });Step 3 · Verify
In Vendor panel → Tracking setup, click Verify installation, then Send test conversion.