Refersion
Refersion is an affiliate-marketing attribution platform. When a visitor arrives through an affiliate link, Refersion’s tracker records the click and ties it to an opaque cart_id. When the order is paid, your backend reports it to Refersion with the same cart_id, and Refersion credits the sale to the referring affiliate.
Datafly Signal sends that paid-order report server-side from your own infrastructure, so you do not need Refersion’s conversion pixel on your thank-you page. Signal delivers each Order Completed event to Refersion’s inbound order webhook.
Prerequisites
- A Refersion merchant account.
- Your Refersion Public Key and Secret Key, found in the Refersion dashboard under Account → Settings → Refersion API.
- The Refersion click tracker running on your storefront so referral clicks are captured and a
cart_idis generated. Signal handles the conversion side only — the click side is still served by Refersion’s front-end script. - A stable
cart_idavailable to your backend at order time that matches the value reported to Refersion’s tracker (rfsn.cart) when the visitor first landed. This is usually your cart token or checkout id. Without a matchingcart_id, the conversion is recorded but not attributed to any affiliate.
Configuration
| Field | Required | Description |
|---|---|---|
| Refersion Public Key | Yes | API public key from Account → Settings → Refersion API. |
| Refersion Secret Key | Yes | API secret key paired with the public key. Stored encrypted. |
Configure in Signal
- In the Signal management UI, go to Integrations and add Refersion.
- Paste your Public Key and Secret Key.
- Select the Retail preset, which maps
Order Completedto Refersion’s paid-order webhook. - Attach the integration to the pipeline that carries your purchase events and enable it.
API Endpoint
Signal delivers to Refersion’s inbound order webhook:
POST https://inbound-webhooks.refersion.com/tracker/orders/paid
Refersion-Public-Key: <your public key>
Refersion-Secret-Key: <your secret key>
Content-Type: application/jsonSignal injects the key pair from your integration config — you never put credentials in the page.
Identity Signals
Refersion attribution is driven by the cart_id, not by a hashed PII match. The cart_id is the join key between the affiliate click (recorded by Refersion’s front-end tracker as rfsn.cart) and the paid order Signal posts later.
cart_id— the referral join key. It must be the same opaque value your storefront reported to Refersion at click time. Send it on theOrder Completedevent asproperties.cart_id.customer.email,customer.first_name,customer.last_name— optional, used by Refersion for reporting and de-duplication. Sent in clear (Refersion does not require hashed PII on this endpoint).customer.ip_address— the visitor IP, forwarded from the event context for fraud and geo checks.
Event Mapping
Signal maps a single conversion event. All other events are dropped.
| Signal event | Refersion fields |
|---|---|
Order Completed | cart_id, order_id, currency_code, shipping, tax, discount, discount_code, customer{}, items[] |
Example
A purchase tracked with Datafly.js:
datafly.track("Order Completed", {
cart_id: "DDXqfBngTWuX8N8Asqr2mY3RkmHCXdM7Vz6mdHkjwrEnN5zyRY",
order_id: "20150401102883",
currency: "USD",
shipping: 9.99,
tax: 0.57,
discount: 2.25,
coupon: "HOLIDAY1",
products: [
{ sku: "PROD_A", name: "Product A", price: 5.50, quantity: 2 }
]
});With the customer’s email previously identified:
datafly.identify({ email: "jdoe@domain.com", first_name: "John", last_name: "Doe" });Produces this request to Refersion:
{
"cart_id": "DDXqfBngTWuX8N8Asqr2mY3RkmHCXdM7Vz6mdHkjwrEnN5zyRY",
"order_id": "20150401102883",
"currency_code": "USD",
"shipping": 9.99,
"tax": 0.57,
"discount": 2.25,
"discount_code": "HOLIDAY1",
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "jdoe@domain.com",
"ip_address": "234.192.4.75"
},
"items": [
{ "sku": "PROD_A", "name": "Product A", "price": 5.50, "quantity": 2 }
]
}Testing
- Trigger a test purchase through an affiliate link so a
cart_idis recorded by Refersion’s tracker. - Fire an
Order Completedevent carrying that samecart_id. - In the Refersion dashboard, open Conversions and confirm the order appears with the correct affiliate, order total, and line items.
- In Signal’s Event Debugger, confirm the delivery returned a 2xx and the payload shows
cart_id,order_id, and theitemsarray.
Troubleshooting
- Conversion shows in Refersion but no affiliate is credited — the
cart_iddid not match a recorded click. Confirm thecart_idyou send equals the value Refersion’s tracker stored (rfsn.cart) for that visit. - 401 / 403 responses — invalid or revoked key pair. Re-copy both the Public Key and Secret Key from Account → Settings → Refersion API.
- 400 response — missing a required field (
cart_id,order_id, orcurrency_code) or a malformeditemsentry. Each item needssku,price, andquantity, and prices must be plain numbers with no currency symbol. - Duplicate conversions — if Refersion’s client-side conversion pixel is also live on your thank-you page, you may double-record the order. Use the server-side delivery only and remove the client-side conversion snippet.