WooCommerce influencer tracking

See which influencers actually sell on your WooCommerce store: a tracked link for each one, and every order that follows it credited to the person who sent it.

How do I track influencer sales on WooCommerce?#

WooCommerce gets you part of the way on its own. Give each influencer their own coupon under Marketing → Coupons, and WooCommerce Analytics will show how many orders used it and how much it discounted. What it cannot show is the shopper who tapped an influencer's link, came back two days later and paid full price without the code — or whether, once you add it all up, that influencer earned what you paid them.

The usual next step is an affiliate plugin or UTM links read in Google Analytics. An affiliate plugin is built for paying commission, so it normally asks every influencer to sign up and log in as an affiliate. UTM links credit traffic sources rather than people, so a sale ends up attributed to "instagram / story" instead of to the person who posted it.

Yonto works alongside what WooCommerce already has. Each influencer gets a tracked link, and a short script on the order-received page reports every order that followed one, with its real total straight from WooCommerce. Each sale is credited to the influencer whose link the shopper came through, and each influencer's line shows what they sold against what you paid them. That is creator attribution, and nobody has to log in to anything but you.

Keep giving influencers their coupons — shoppers expect a code. But on WooCommerce, Yonto credits a sale through the link: a shopper who types the code without ever clicking is not counted by the script. If coupon-only sales matter to you, report orders from your server instead, where your own code can credit any order that used an influencer's coupon.

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

How it works on WooCommerce#

Yonto credits each sale to the individual influencer who drove it — creator attribution. On WooCommerce, 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: The order-received (thank you) page.

  1. 1
    Add the pixel site-wide
    Appearance → Theme File Editor → header.php, just before </head>. Or use a header-scripts plugin if you would rather not edit the theme.
    html
    <script async src="https://yontosales.com/p.js" data-proof="YOUR_TRACKING_CODE"></script>
  2. 2
    Fire the conversion on the thank-you page
    Add this to your child theme's functions.php. It runs on the order-received page and passes WooCommerce's own order id and total.
    html
    add_action('woocommerce_thankyou', function ($order_id) {
      $order = wc_get_order($order_id);
      if (!$order) return;
      ?>
      <script>
        proof('conversion', {
          value: <?php echo esc_js($order->get_total()); ?>,
          id: '<?php echo esc_js($order->get_order_number()); ?>',
          currency: '<?php echo esc_js($order->get_currency()); ?>'
        });
      </script>
      <?php
    });
  3. 3
    Create a matching coupon
    Marketing → Coupons, named exactly as your campaign's code, so shoppers who follow the link get their discount.
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 WooCommerce.

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.
  • The order's real total and currency, straight from WooCommerce.
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 — WooCommerce refunds are not sent to Yonto, so a refunded order stays counted.

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.

Worth knowing#

  • If your theme caches the thank-you page, the conversion call may not run. Exclude order-received from caching.
  • For a more reliable path, report from PHP with the server-side API instead of the browser.

Making it more accurate#

  • Ask the influencer to share the link, not just the code. On WooCommerce 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. WooCommerce 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.