Admitad Integration: Last Paid Click Tracking
The integration tracks orders from Admitad partners using their Last Paid Click attribution model.
Admitad Affiliate Network Integration
We connected an InSales store to Admitad's affiliate network so paid orders go through automatically and canceled orders get reversed. This keeps your affiliate stats clean and reduces wrong payouts.
What We Built
The integration tracks orders from Admitad partners using their Last Paid Click attribution model. When someone clicks an affiliate link, we capture the click ID. When they buy, we send that data to Admitad. If they cancel, we tell Admitad to reverse the commission.
InSales doesn't track affiliate sources by default, so we built a custom solution using their API.
How It Works
1. Tracking Link Setup
We generate Admitad tracking links with these parameters:
?utm_source=admitad&utm_medium=cpa&utm_campaign=#wm_id#&click_id=#click_id#
When someone clicks, we save the click_id to a cookie with a 30-day expiration.
2. Order Attribution
When a customer completes checkout, we link their order to the saved click_id. We also tag the order in InSales with a custom field so store managers know it came from Admitad.
3. Postback Notification
After payment confirmation, we send a postback request to Admitad:
https://ad.admitad.com/r?campaign_code={code}&postback=1&postback_key={key}&action_code=1&uid={click_id}&order_id={order_id}&payment={total}¤cy_code=USD
This tells Admitad to credit the affiliate who sent the customer.
4. Cancellation Handling
If an order gets canceled or refunded, we send another postback to reverse the commission. This prevents affiliates from getting paid for orders that didn't complete.
Technical Details
Last Paid Click Attribution
Admitad uses Last Paid Click attribution. If someone clicks multiple affiliate links before buying, only the last paid traffic source gets credit. Free sources like email or organic search don't overwrite the affiliate cookie.
API Integration
We use InSales API to:
- Write custom order fields with the affiliate source
- Track order status changes
- Trigger postback requests on payment or cancellation
Cookie Management
The admitad_uid cookie stores the click ID for 30 days. We don't modify or delete it when users return from free traffic sources. This ensures proper attribution under Admitad's model.
Testing and Validation
We worked directly with Admitad's support team via Telegram to validate the integration. This sped up testing and confirmed that postbacks were being received correctly.
The client received:
- Test tracking links with sample click IDs
- Instructions for bulk testing multiple scenarios
- Documentation on required parameters and format
- Validation checklist for production deployment
Required Postback Parameters
| Parameter | Description | Required |
|---|---|---|
| campaign_code | Your Admitad campaign identifier | Yes |
| postback_key | Security key from Admitad settings | Yes |
| uid | The click_id from the tracking link | Yes |
| order_id | Your store's order number | Yes |
| payment | Total order amount | Yes |
| currency_code | Currency (USD, EUR, etc.) | Yes |
Why This Matters
Affiliate networks need accurate order data. Without proper integration, you might pay commissions on canceled orders or miss legitimate sales.
This setup ensures affiliates get paid fairly and your tracking stays transparent. Store managers can see which orders came from Admitad, and affiliates can trust the data they see in their dashboard.