Affiliatant for WooCommerce
Affiliate tracking for WooCommerce.
Install in
This plugin connects a WooCommerce store to an affiliate programme you run at
Affiliatant. It records which referral brought a shopper to the store, and it
tells Affiliatant when that shopper buys, when the order is refunded and when
a subscription renews. Affiliatant works out what is owed. Nothing in this
plugin moves money.
An Affiliatant account is required. The plugin does nothing until you enter an
API key and a programme id, and it requires WooCommerce: without WooCommerce
active it records nothing and says so on the Plugins screen.
Everything described below is in this plugin. There is no trial, no licence
check, and no feature here that waits for a payment.
What it does
- Click capture, server side. A shopper arriving with
?aftid=is
recorded by PHP on the landing request. The click id is kept on the
WooCommerce session, and, once the visitor consents, in a first-party
cookie for thirty days by default. - Asks the visitor when there is no consent plugin. A shopper who arrives
through a partner link sees a short question at the foot of the page asking
whether the shop may remember the referral. Nobody else sees it, and it is
not shown again once answered. A consent plugin, when one is active, decides
instead. - A beacon for cached pages. A cached page never runs PHP, and some edge
caches strip the query string before the request reaches the origin. A small
script reads the address bar and posts the click id to your own site’s
admin-ajax.php. It posts to your site, not to ours, and it sends nothing
when there is no click id in the URL. The same script shows the question to
the visitor, so that works on a cached page too. - Classic checkout and Blocks. The referral is bound to the order on both
the classic checkout hooks and the Store API hooks the Blocks checkout uses. - Sales. An order reaching a status you count as paid is reported once.
The default is whatever WooCommerce itself calls paid. - Refunds and cancellations. A refund or a cancellation is reported as a
reversal, so a commission can be withdrawn. - Subscription renewals. Renewal payments taken by WooCommerce
Subscriptions are reported, carrying the id of the order that started the
subscription. - Coupon codes. Codes used on the order are sent, so a sale can be
attributed to a code when there was no click to follow. - sub1 to sub5. Five pass-through parameters are carried from the landing
URL to the conversion. - A local queue. Every event is written to a table in your own database
first and sent afterwards by a background job, through Action Scheduler
where it is available and WP-Cron where it is not. A checkout is never held
up by a network call, and an event that cannot be sent is retried rather
than lost. - Reconciliation. The server report and the receipt pixel carry the same
deterministic event id, so one sale is counted once. - A receipt pixel, which can be switched off.
- A connection test that sends a real conversion marked as test data, so
pressing it proves the key, the programme id, the signature and the network
at once without creating a commission. - A status panel showing the queue, the last event sent and the last
error, with retry and clear. - An order meta box showing the click id bound to that order, and letting
you set one by hand. - Test mode, which marks everything sent as test data.
- HPOS and Blocks compatibility, declared. Order data is read and written
through the WooCommerce CRUD API only.
What it does not do
It does not run the affiliate programme. Affiliates, links, commission rates,
approvals and payouts live in Affiliatant, not in WordPress. It does not add
an affiliate dashboard or a registration form to your site. It does not cloak
links. It does not pay anybody.
What your Affiliatant account does with it
This plugin reports what happened in your shop. The commission tracking,
and everything after it, happens in Affiliatant:
- Commission is calculated per sale, at a rate you can set per product, per
category, per campaign or per partner, with volume tiers and recurring
commission on repeat orders. - Every conversion records the reason it was attributed, or the reason it was
not. A sale no affiliate referred stays unattributed rather than being
credited to somebody. - Affiliate payouts are prepared in batches, with the payment leaving your own
bank, PayPal or Wise. Affiliatant holds no money and takes no percentage. - For a UK partner program, Affiliatant raises the self-billed invoice
under VAT Notice 700/62, including the cases that are awkward by hand:
an affiliate who is not VAT registered, and an affiliate outside the UK.
Somebody has to raise an invoice for every commission paid, most affiliates
never do, and chasing them is not a system.
Money
Every amount is sent as a whole number in the currency’s minor unit, together
with the currency of the order, calculated with string arithmetic rather than
floating point.
External services
This plugin relies on one external service, Affiliatant, and contacts nothing
else. It contacts nothing on activation, and nothing on a schedule, until you
have entered an API key and a programme id on its settings screen.
Affiliatant is a service run by Havenswift Hosting, and it is what makes the
plugin useful: it holds the affiliate programme, matches each sale to the
referral that produced it and calculates the commission.
Affiliatant, from your server. When an order reaches a paid status, is
refunded, is cancelled, or a subscription renews, your server sends that event
to Affiliatant. It is sent by a background job, not during the shopper’s
checkout request. The settings screen’s connection test sends one event the
same way, marked as test data.
What is sent: your programme id and store reference; the order id and order
number; an event id; the kind of event; the order total, tax, shipping and
discount as whole numbers in the minor unit; the currency; the date of the
order; a test flag; the line items, each with its name, SKU, product and
variation ids, quantity, unit and line amounts and tax; any coupon codes used;
the payment method identifier; for a renewal, the id of the original order;
the numeric WordPress customer id where the shopper has an account; the click
id; sub1 to sub5; and the landing URL the shopper arrived on. The request
carries your API key and a user agent naming the versions of this plugin,
WooCommerce and WordPress.
What is not sent: no customer name, no email address, no postal address, no
telephone number and no IP address.
Service: https://affiliatant.com
Terms: https://affiliatant.com/legal/terms
Privacy: https://affiliatant.com/legal/privacy
Affiliatant, from the shopper’s browser. When the receipt pixel is on, the
order-received page includes a one-pixel image served by Affiliatant. The
request is made by the shopper’s browser and therefore carries their IP
address and the address of the page. It is sent only on the order-received
page, only for an order whose status is one of the paid statuses in the
settings, and only when the plugin is configured and the pixel setting is on. Turn
the pixel off in the settings and no request is made from any visitor’s
browser.
What is sent: your programme id and store id; the order id; the event id; the
kind of event; the order total, tax and shipping as whole numbers in the minor
unit; the currency; the date of the order; the click id; the coupon code; the
numeric WordPress customer id where the shopper has an account; and a test
flag. The whole query is signed.
Service: https://affiliatant.com
Terms: https://affiliatant.com/legal/terms
Privacy: https://affiliatant.com/legal/privacy
The click beacon described above posts to your own site’s admin-ajax.php. It
is not a request to Affiliatant and no third party receives it.
There is no usage tracking, no telemetry and no analytics of any kind.
The plugin is published by Havenswift Hosting,
https://www.havenswift-hosting.co.uk/
Third-party libraries
The Affiliatant PHP SDK is included at lib/AffiliatantClient.php. It is one
file, written by us, and it is published under the MIT licence while the rest
of the plugin is GPLv2 or later. MIT is GPL-compatible. No other library ships
with this plugin and nothing is minified.
Written by Joobi from the project's own listing. See the source page
1.2.0
- With no consent plugin, the shop now asks the visitor by default. A shopper
who arrives through a partner link sees a short question at the foot of the
page: Yes sets the referral cookie, No stores only that answer and the
question is not repeated. Setting the cookie without asking, and not setting
it, are still available. - A consent plugin counts only once it sets a consent type through the WP
Consent API. The API installed on its own no longer counts as consent. - On upgrade, a shop set to set the cookie without asking keeps that choice;
every other shop moves to asking the visitor. - The status panel says whether a consent plugin or the setting decides.
1.1.0
- The referral cookie waits for consent. With a consent plugin that supports
the WP Consent API it is set only once the visitor allows marketing
cookies; without one, a new setting decides, and it starts at no cookie.
The referral is always kept for the visit itself, on the WooCommerce
session, which the plugin starts for a referred shopper who has none. - The receipt pixel reports only an order in one of the paid statuses, so an
order awaiting payment is reported when it is paid, by the server. - Saving the settings no longer switches the receipt pixel off.
1.0.1
- The bundled API client no longer contains cURL or stream fallbacks.
All HTTP goes through the WordPress HTTP API.
1.0.0
- First release.
Follow this listing's changes (Atom feed)