Skip to main content

Integration reference

JavaScript SDK

Two script tags. The first remembers which click brought the visitor, the second reports the sale. No cookie is set and nothing that identifies a person is stored.

The two tags

The first goes on every page traffic can land on, including your landing pages. The second goes on the confirmation page only, once the order exists.

On every landing page
<script src="https://tracking.wowmediametrics.pl/sdk.js"></script>
On the confirmation page
<script>
  wo.conversion({ txn: 'ORDER-1', revenue: 49.00, goal: 'signup' });
</script>

What it keeps, and where

  • On load it looks for wo_click_id or wo_view_id in the current URL and keeps whichever it finds.
  • In the page’s own local storage, under wo_ref, for up to 30 days — the longest window an offer can set. On Safari and other WebKit browsers that storage is usually cleared after about seven days of browsing, and after that a conversion arrives with no click id. If the window matters more than the convenience, report with the server-to-server postback instead.
  • No cookie, so third-party cookie blocking does not affect it. The storage belongs to the page the visitor is on, not to us — which is why a click id kept on one of your domains cannot be read from another.
  • wo.ref() returns the id being held, or nothing. Useful for putting the value into your own order record as well.

What conversion takes

The options, and every one of them is optional
OptionWhat it is
txnYour own order or transaction id. It is recorded with the conversion and is how either side finds this sale again later. It is not what stops a repeat being paid twice, except on a goal the network set to count every order, reported with a site key: there it is.
revenueWhat the sale was worth to you, as a decimal amount. The network prices the conversion from its own rule: on a percentage offer, what you are invoiced and what the partner is paid are each a percentage of this figure. It is stored as integer micros rather than as a float.
currencyThe three-letter code of the currency the order was paid in, read on every conversion call. It never chooses a currency: when a percentage rule is in another one, the conversion is recorded with no payout rather than converted. Leave it out and the value is taken to be in the currency of the rule that prices it. With a site key anything but three capital letters is refused; without one it is recorded with no payout instead.
goalWhich goal converted, as the wire key the network gave you. Leave it out on an offer with a single goal.
refReport against this id instead of the stored one. This is the escape hatch for a checkout that spans two domains.

It sends POST /sdk/conversion with the stored id as click_id, so every rule on the postback page applies unchanged — the same window, the same pricing, the same duplicates, the same answers.

What it answers

  • The promise always resolves, never rejects. Analytics must not be what stops a customer reaching their receipt, so a failure is a value rather than an exception.
  • Nothing stored and nothing passed answers no_reference without making a request. That is the answer to look for first when conversions do not arrive.
  • A request that did not complete answers network_error. The sale is not reported and nothing retries it.
  • The request is made so that it survives the navigation which usually follows a purchase.