Server-side tracking
Server-side tracking, sometimes called S2S or backend tracking, means that conversions are sent directly from your server to Addrevenue instead of via the visitor's browser.
This differs from client-side tracking, also called frontend tracking, where the tracking is done via JavaScript in the browser. Client-side tracking is often easier to get started with, but is also more dependent on the browser environment. Server-side tracking gives you more control over when and how a conversion is submitted, and is therefore often a good choice when tracking needs to be more robust or when the conversion itself occurs later in the process.
When should you use server-side tracking?
Server-side tracking is often used for so-called offline conversions, that is, when the conversion does not occur directly on the website.
This could be, for example, when a user submits an application online, but where the actual transaction occurs at a later time. A common example is in finance, where a visitor applies for a loan on the website, but the commission is based on the loan disbursed. In such a case, the conversion only occurs when the loan is actually disbursed, which is often several days later.
But server-side tracking is at least as relevant for regular online purchases. By moving conversion tracking to your server, you reduce the dependency on the browser, which often results in more stable and consistent data collection.
- More robust data quality
- Fewer lost conversions
- Better consistency between systems
How it works
The flow is basically:
- A user clicks on an affiliate link.
- Addrevenue registers the click and generates a clickId.
- The user lands on your website with clickId, advertiserId and channelId as parameters in the URL.
- You save these values in your own environment linked to the session.
- When a conversion occurs, your server sends a postback to Addrevenue.
It is important that you save all three values, clickId, advertiserId and channelId, so that they can be sent at the time of conversion.
Storage on your server
How you choose to store the data is up to your implementation, but some general guidelines are often good to follow:
- Always save clickId, advertiserId and channelId.
- Link the values to session, order, customer or other relevant server-side identity.
- Ensure that the data survives the entire purchase journey, even if it consists of several steps.
- Make sure that the storage works in edge cases, such as return visits or preferably multiple devices, so-called cross-device, if possible.
- Avoid storing more data than necessary.
Often a combination of server-side session, own first-party cookie and later connection to order or customer is used.
Redirect parameters to your website
When traffic is sent from Addrevenue to your website, parameters are normally sent in the redirect, so that you can save them for later use in the postback.
The most important parameters to capture are:
- clickId
- advertiserId
- channelId
We can also customize both the names of the parameters and which parameters are sent in the redirect to your website. This is often important if you are using existing systems or third-party tools for server-side tracking that expect different names, for example their own internal parameters or formats similar to adv_sub, aff_sub2 or aff_click_id.
The names of the parameters in the postback to Addrevenue are more strict, however, and must follow our scheme below.
Send postback to Addrevenue
For server-side tracking, you send a request to:
https://addrevenue.io/t
This can be done either as POST with JSON payload or as GET with parameters in the URL. For simpler implementations, both can work, but if you want to send more advanced data, such as product lists, JSON payload is the clearest option.
Parameters
Required Parameters
- type
For most e-retailers, this is Purchase, but can be any string as long as it matches the Conversion Event ID in your commission program on our platform. - orderId
A unique identifier for the conversion. Used for deduplication and identification between platforms. - clickId
Identifies the click to be attributed. - advertiserId
Your advertiser ID at Addrevenue. - channelId
ID of the affiliate channel that sent the traffic.
Conditional parameters
- value
The conversion value, usually the order amount. - currency
Currency code according to ISO 4217, for example SEK or EUR.
These are mandatory if you use variable commission type, which is then based on order value.
Optional parameter
- market
Country code, normally according to ISO 3166-1 alpha-2, for example SE or DE.
If missing, we try to derive the market from the user and the first click.
Optional parameters for e-commerce
For e-retailers, there are also some extended, optional parameters that may be relevant depending on your setup.
Discount codes
discountCodes can be sent as a comma-separated list of the discount codes that have been used in the purchase.
This is mainly used for discount code tracking, i.e. when a purchase can be attributed via a discount code even if no click has been registered. A typical example is when an affiliate publishes an exclusive discount code in a post or on social media without linking to the website at the same time.
Products
It is also possible to send the entire shopping cart in the products parameter.
products is sent as an array of objects, where each object should contain properties such as:
- item_id
- item_name
- price
- quantity
- category
The purpose is partly that you as an advertiser can get statistics per product, and partly that you can create rule-based commission programs with different commissions for individual products.
Since products is a more complex data structure, it is suitable best suited for postback via JSON payload, rather than via GET parameters.
Both discountCodes and products are optional and primarily relevant for e-retailers.
Example of GET
Data is sent as parameters in the URL in a GET request:
https://addrevenue.io/t?type=Purchase&advertiserId=YOUR_ADVERTISER_ID&channelId=123456&clickId=61f180ac133415.32320128&value=42.30¤cy=EUR&orderId=W6234&market=DE
Example of POST with JSON payload
Data is sent in JSON format as a POST-request to:
https://addrevenue.io/t
with header:
Content-Type: application/json
and JSON-body as below:
{
"type": "Purchase",
"advertiserId": "YOUR_ADVERTISER_ID",
"channelId": "123456",
"clickId": "61f180ac133415.32320128",
"value": 42.30,
"currency": "EUR",
"orderId": "W6234",
"market": "DE"
}
Example of POST with extended e-commerce data
If you want to send discount codes and product data, POST with JSON payload preferred:
{
"type": "Purchase",
"advertiserId": "YOUR_ADVERTISER_ID",
"channelId": "123456",
"clickId": "61f180ac133415.32320128",
"value": 42.30,
"currency": "EUR",
"orderId": "W6234",
"market": "SE",
"discountCodes": "SPRING20,INFLUENCER10",
"products": [
{
"item_id": "SKU-123",
"item_name": "Running Shoes",
"price": 29.90,
"quantity": 1,
"category": "Shoes"
},
{
"item_id": "SKU-456",
"item_name": "Sports Socks",
"price": 12.40,
"quantity": 1,
"category": "Accessories"
}
]
}
Integration with existing systems
If you already use a tool or platform for server-side tracking, in most cases it is possible to integrate with Addrevenue without major changes.
As long as the necessary data can be passed on in the mailback, we can often adapt the redirect to the format you need, while the mailback to us follows our schedule.
Platform support
Our plugins for WooCommerce and Shopify will soon have server-side tracking as standard. For many, this means that the implementation can be done with significantly less in-house development.
Summary
Server-side tracking is a flexible and robust way to report conversions to Addrevenue, both for delayed conversions and for regular e-commerce.
The most important thing in the implementation is that you capture and save clickId, advertiserId and channelId when the user lands on your website, and that these are sent back to Addrevenue when the conversion occurs.
For e-retailers, there is also the option to supplement with discountCodes and products when there is a need for discount code tracking, product statistics or more detailed commission rules.
Create account
By submitting I accept addrevenue.io's terms of use and privacy policy.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
By submitting I accept addrevenue.io's terms of use and privacy policy.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
By submitting I accept addrevenue.io's terms of use and privacy policy.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Choose the account type that best suits your profile