Influencer tracking for custom-built sites

Track which influencers drive sales on a site you built yourself: one script tag on every page, one call when an order succeeds, or a report from your server.

How do I track influencer sales on a custom-built site?#

With your own checkout, nothing is tracked for you: there is no built-in coupon report, no app marketplace, and no plugin to install. You can hand each influencer a code and query your own orders for it, but that misses every shopper who came through an influencer's link without using it, and it still leaves you to set each influencer's sales against their fee by hand.

UTM parameters and Google Analytics are the usual fallback. They show which platform sent visits, not which person sent buyers.

Yonto takes one script tag on every page, which remembers which influencer's link a shopper came through, and one call where you know the order succeeded, passing its id and total. That is all creator attribution needs from the browser. Because you own the backend, you can also report orders from your server instead: the order reaches us without a browser, so nothing in the shopper's browser can stop it, and your own code can credit an order that used an influencer's coupon even when the shopper never clicked.

Track influencer sales on a custom-built site with Yonto
One tracked link per influencer, and each one's sales set against what you paid them.
Start free

How it works on a custom-built site#

Yonto credits each sale to the individual influencer who drove it — creator attribution. On a custom-built site, there are two ways it reaches us, and the browser pixel does most of the work:

Browser pixel — primary on this platform
A small script on your confirmation page reports the order. Depends on the shopper accepting cookies and not blocking scripts.
Server-side API
Your backend reports the order to our API with a secret key. The most reliable path, and the most work.

Setting it up#

Every campaign has its own tracking code. The snippets below use YOUR_TRACKING_CODE as a placeholder — copy the real ones from the campaign's Setup screen, which fills them in for you.

Conversions are reported from: Wherever you know the order succeeded.

  1. 1
    Add the pixel to every page
    It must be on the landing page as well as the confirmation page — the landing page is where the click is captured, the confirmation page is where it is spent.
    html
    <script async src="https://yontosales.com/p.js" data-proof="YOUR_TRACKING_CODE"></script>
  2. 2
    Fire the conversion on success
    Call proof() once the order exists and you know its id and total. Safe to call for any visitor: for one nobody referred it does nothing.
    html
    <script>
      // On your order-confirmation page, once the order is known.
      // Both fields are REQUIRED for a sale campaign.
      proof('conversion', {
        value: 49.90,          // the order total, as a number
        id: 'ORDER-1234',      // your order id — this is what prevents double counting
        currency: 'GBP'        // what the shopper actually paid in
      });
    </script>
Warning.on a sale campaign, value and id are both required. The order id is what makes a retry or a refreshed confirmation page idempotent instead of a second sale. A call missing either is rejected — see the Conversion endpoint reference.

What this can and cannot see#

Attribution is never complete, on any platform. You are about to pay a creator on the strength of these numbers, so here is exactly what is behind them on a custom-built site.

Counted
  • Orders completed in the same browser that clicked the link, within the business's click window and no more than 30 days after the click, because the pixel keeps the click for 30 days.
Not counted
  • Orders that used the creator's discount code but never followed their link. The script only reports shoppers who arrived through a tracked link.
  • Shoppers who refuse tracking cookies — the click is never linked to the sale.
  • Purchases made after the browser deleted the click cookie. Safari deletes a cookie set by a script after 7 days.
  • Purchases made on a different device from the click.
  • Anyone running an ad blocker that blocks our script.
  • Sales where the shopper cleared their browser data between clicking and buying.
  • Refunds, unless you report them yourself.

This is why every figure Yonto reports is described as a confident floor rather than a total. The sales in the right-hand column happened; we simply cannot prove the creator caused them, and we would rather undercount than invent.

Making it more accurate#

  • Ask the influencer to share the link, not just the code. On a custom-built site a sale is credited through the link, so a shopper who only types the code is not counted.
  • Report from your backend instead of the browser. The server-side API sees orders that no browser-based method can.
  • Report refunds. Custom site does not tell us when you refund an order. A refunded sale stays counted until your server reports the refund through the server API, naming the order id the sale was sent with.