While the standard Partnac JavaScript tracker (tracker.js) is the recommended method for most websites, some scenarios require a different approach. If you need to track backend subscription renewals, integrate with a CRM, or operate in environments that block JavaScript, you can use API Postbacks (Server-to-Server) or Image Pixels.
Here is how to implement these robust, alternative tracking methods on Partnac.
Method 1: Server-to-Server (S2S) Postbacks
Server-to-Server tracking (often called a Postback) is the most secure and accurate tracking method available. Instead of relying on the user's browser, your backend server makes a direct HTTP request to Partnac's API the moment a conversion occurs.
Because this happens behind the scenes, it is 100% immune to ad-blockers, privacy browsers, and cookie clearing.
How to send a Postback via API
When a conversion happens (e.g., a Stripe payment succeeds or a CRM lead is closed), your server should send a POST request to Partnac's tracking endpoint.
Headers: Requires your Partnac API Key for authentication.
Example Payload:
- {
- "partnership_code": "PARTNER_REF_123",
- "unique_id": "sub_456789",
- "conversion_type": "subscription",
- "amount": 49.00,
- "metadata": {
- "currency": "USD",
- "customer_id": "cus_9876",
- "coupon_code": "WELCOME10",
- "ip_address": "192.168.1.1",
- "user_agent": "Mozilla/5.0..."
- }
- }
Note: Because this is a server request, you should try to pass the user's ip_address and user_agent in the metadata for fraud prevention and accurate analytics. In addition, your customer_id should be the same as the one used for referral tracking for the same user.
Method 2: Image Pixel Tracking (1x1 Pixel)
An Image Pixel is a fallback method used when you cannot use JavaScript (such as inside HTML emails) and cannot make server-side API calls. It works by loading a tiny, invisible 1x1 image from Partnac's servers.
When the user's browser requests the image, Partnac reads the URL parameters and registers the conversion.
How to use an Image Pixel
You simply place an <img> tag on your success or thank-you page. The src URL must point to Partnac's GET /v1/tracking endpoint, with your conversion details passed as query parameters.
Example HTML Pixel Snippet:
Required URL Parameters for Pixels:
- event=conversion: Tells Partnac this is a conversion event.
- campaign_id: Your unique Partnac Campaign ID.
- partner (or coupon_code): The affiliate's unique code to ensure they get credited.
- unique_id: Your system's unique order/sales/subscription/invoice ID for a sale conversion, or Lead/user ID for a signup conversion (prevents duplicate tracking).
- customer_id: Your user's id. This should be the same throughout the lifecycle of the user conversions from lead, signup to sale
- amount: The total value of the conversion.
- conversion_type: E.g., sale, lead, or signup.
(Optional: You can also pass a JSON-encoded string to the metadata parameter for extra context).
Related Articles
Integrating Partnac Tracking into Your Website
The foundation of any successful partner program on Partnac is accurate tracking. The Partnac tracking script (tracker.js) seamlessly attributes clicks to the right partners and tracks when those clicks result in a conversion, such as a signup, ...
Setting Up Your Brand Profile
Your brand profile is your storefront on Partnac. It's the first thing creators see when they discover your brand, evaluate partnership opportunities, or consider joining your affiliate program. A complete, compelling profile doesn't just look ...
Welcome to Partnac: A Quick Start Guide for Brands
Welcome to Partnac. You're here because you want to grow your brand through partnerships, whether that's affiliate marketing, influencer collaborations, or creator partnerships. This guide will get you up and running in the next 15 minutes. Partnac ...
Creating Your First Partnership Campaign
Creating your first partnership campaign on Partnac is straightforward. This guide walks you through the entire process, from defining your goals to launching your program and attracting your first partners. Whether you're launching a partnership ...
Understanding Partnac's Partnership Models
Not all partnerships are created equal. On Partnac, you can run different types of campaigns depending on your goals, budget, and what you're trying to achieve. Understanding these models helps you choose the right approach and set up campaigns that ...