Before proceeding, you should have a program created on Partnero. If you haven’t created one yet, refer to the Knowledge Base for guidance.
How it works
- A visitor arrives at your site via a partner’s referral link (e.g.,
yoursite.com?ref=PARTNER_KEY) - PartneroJS stores the partner’s key in a
partnero_partnercookie - When the visitor signs up, your backend reads the cookie and sends it to Partnero along with the customer data
- When the customer makes a purchase, your backend records the transaction
- Partnero calculates the partner’s commission automatically
Step 1: Install PartneroJS
PartneroJS tracks referral visits by reading the partner key from the URL and storing it in a first-party cookie. This cookie is what your backend reads later during sign-up.1
Get your snippet
- Log in to Partnero
- Go to Programs and select your program
- Navigate to Integration in the sidebar
- Copy the PartneroJS snippet
2
Install the snippet
Paste the snippet into your website’s HTML just before the closing
</head> tag:partnero_partner cookie containing the partner’s unique key. This cookie persists for the duration configured in your program settings (default: 30 days).
Step 2: Track sign-ups
When a new user signs up, your backend reads thepartnero_partner cookie from the request and sends it to Partnero to attribute the customer to the referring partner.
How to get the partner key
Thepartnero_partner cookie is set by PartneroJS and sent with every request to your domain. Read it on your server:
- Node.js / Express
- PHP / Laravel
- Python / Django
- Ruby on Rails
Create the customer
Pass the partner key along with the customer data:Request body
*Provide at least one of
partner.key, partner.email, or partner.id.
Response
Step 3: Track sales
When a customer makes a purchase, record the transaction so Partnero can calculate the partner’s commission.Request body
Multiple transactions
Send multiple transactions for the same customer in a single request:Complete integration example
Here’s the full flow in a Node.js/Express backend:Next steps
API reference
Full REST API documentation
Webhooks
Get real-time notifications for partner events
Mobile apps
Integrate tracking in iOS and Android apps
JavaScript SDK
Client-side tracking without a backend
