How to track sales from WooCommerce

WooCommerce orders attributed with the real amount.

AT A GLANCE

What NEMO tracksSales
ConnectionGuided — step by step, no server code involved
MethodThe thank-you page” · Thank-you page · good reliability
Steps4 in total, with a one-minute check at the end
Worth knowingThe snippet uses the hook that ALSO works on modern block themes (many tutorials use an old one that never fires there).

With WooCommerce, NEMO tracks which link brings each sale with no pixels and no Google Analytics. Know which link, video or ad brought you each WooCommerce order — amount included, on your own domain. Everything happens on your domain: nemo.js stores the source and a mini-snippet on the order received page records the sale with the real total. No theme edits: two pastes with the free WPCode plugin. The method is “The thank-you page” (thank-you page · good reliability): After paying, the buyer lands on a page of yours with the NEMO script: the sale is recorded there with its source (the 90-day cookie). It depends on the purchase happening in the same browser as the click. The snippet uses the hook that ALSO works on modern block themes (many tutorials use an old one that never fires there). The full connection is 4 steps and you verify it with a single test click.

How is each WooCommerce sale attributed?

The thank-you page · Thank-you page · good reliability

Everything happens on your domain: nemo.js stores the source and a mini-snippet on the order received page records the sale with the real total. No theme edits: two pastes with the free WPCode plugin.

  1. Install the free “WPCode” plugin (Plugins → Add New → search for WPCode).
  2. In WPCode → Header & Footer, paste the NEMO script into “Header” (so it runs across your whole site):
    <script src="https://nemolink.app/nemo.js" defer></script>
  3. In WPCode → Code Snippets → Add New → “PHP” type, paste this snippet and activate it (it records the sale with the order total, once per order):
    add_action( 'woocommerce_before_thankyou', function ( $order_id ) {
      $order = wc_get_order( $order_id );
      if ( ! $order || $order->get_meta( '_nemo_sale_tracked' ) ) { return; }
      $order->update_meta_data( '_nemo_sale_tracked', '1' );
      $order->save();
      ?>
      <script>
      window.addEventListener('load', function () {
        if (window.nemo && window.nemo.id()) {
          window.nemo.track('sale', {
            event_name: 'Purchase',
            amount_cents: <?php echo (int) round( (float) $order->get_total() * 100 ); ?>,
            customer_external_id: <?php echo wp_json_encode( (string) $order_id ); ?>
          });
        }
      });
      </script>
      <?php
    } );
  4. Point your NEMO links at your site (home page, product, landing — any page with the script works).

Note: The snippet uses the hook that ALSO works on modern block themes (many tutorials use an old one that never fires there).

Note: If a customer pays on an external gateway and never returns to your site, that sale isn't recorded through this route: the purchase tag in your email platform is the safety net (the official Kit, ActiveCampaign and MailerLite plugins for WooCommerce can tag buyers).

Check it in one minute

  1. Click your own NEMO link to your site.
  2. Place a test order (cash on delivery or a 100% coupon works).
  3. On the “Order received” page, the sale shows up in NEMO with its amount and its source.

Frequently asked questions

What do I do if the order completes but the sale never arrives?
Is the PHP snippet ACTIVE in WPCode? And does the NEMO script load on your site (view the source of any page: nemo.js must appear)?
What do I do if the sale arrives “no source”?
The buyer came in without going through a NEMO link, or a caching/optimization plugin delays the script. The snippet already waits for the page to fully load; if you use an aggressive optimizer, exclude nemo.js from being deferred.
What do I do if i have a custom thank-you page (page builder) and it doesn't fire?
Some page builders replace the order received page and skip WooCommerce's hooks. Use Woo's standard confirmation page or add the notice to your custom page.

OFFICIAL SOURCES

Guide verified against the official documentation on 2026-07-21.

ALSO INTEGRATES WITH

Track WooCommerce from your very first link.

Free during early access. Early users get special terms when paid plans launch.

See all 37 integrations