Connect WooCommerce to Nevian

Time needed: about 10 minutesLast updated:

Send every WooCommerce order to Nevian with an order webhook and two small pieces of code, so each sale, refund and cancellation shows up next to the ad that brought the buyer.

What you need

  • A WordPress administrator login for your store, so you can open WooCommerce › Settings and add code to the site.
  • A way to add code: a plugin that adds code to the site header and one that runs PHP snippets, or a child theme you can edit.
  • A Nevian workspace with an active plan (Beginner, Pro or Enterprise), where you are the owner, an admin or a member. Viewers can't connect integrations.
  • The two tabs side by side: Nevian on Integrations and your WordPress admin.

Steps

  1. In Nevian, open Integrations, click Add integration (Connect provider when nothing is connected yet) and pick WooCommerce. In the Connect WooCommerce window, have the platform open in another tab, then click Next to get your private URL and code.

    The Connect WooCommerce window in Nevian, with the Next button highlighted.
  2. Nevian creates your private Webhook URL. Click the copy button next to it. You can leave this window open while you do the next steps.

    The Webhook URL in the Connect WooCommerce window, with its copy button highlighted.
  3. In WordPress, open WooCommerce › Settings, choose the Advanced tab and then Webhooks, and click Add webhook (Create a new webhook when the store has none yet).

    WooCommerce's Webhooks settings in WordPress, with the Add webhook button highlighted.
  4. In Webhook data, set Name to Nevian, Status to Active, Topic to Order updated and API Version to WP REST API Integration v3. Paste the URL in Delivery URL, leave Secret blank and click Save webhook.

    WooCommerce's Webhook data form with the name Nevian, Status Active, Topic Order updated, the Nevian Delivery URL, a blank Secret, API Version WP REST API Integration v3 and the Save webhook button highlighted.
  5. Back in Nevian, go on to the last step of the window. It reads Connected. Waiting for the first order. Click Done: your first order shows up by itself. WooCommerce also sends a ping by itself when the webhook is saved; once it has arrived, the line reads Test received with the time instead of Connected.

    The Connect WooCommerce window in Nevian showing Connected, with the Done button highlighted.
  6. Back in WordPress, the saved webhook now shows the Secret WooCommerce created. Copy all of it.

    The saved webhook in WooCommerce with the generated Secret highlighted.
  7. In Nevian, click the WooCommerce card in Integrations, open the Connection tab, paste the secret in Webhook secret and click Save. From now on Nevian only accepts calls signed with it.

    The Connection tab of the WooCommerce integration in Nevian, with the pasted Webhook secret and the Save button highlighted.
  8. On the same tab, copy Nevian script for your theme into the <head> of every page (with a header-code plugin or in your theme), and add Click ID snippet (PHP) with a code snippets plugin or to your child theme's functions.php. The snippet saves the click ID on each new order, so the webhook brings it back.

    The two pieces of code on the Connection tab in Nevian: the Nevian script for your theme and the Click ID snippet in PHP.

Check that it works

  • The WooCommerce card in Integrations shows it as connected right away, waiting for the first order.
  • Your first real order shows up in Logs › Webhooks and in the reports once it is Processing in WooCommerce › Orders (a cash on delivery order counts once it is Completed). WooCommerce's ping shows as “Test received” and never counts in revenue.
  • WooCommerce has no test mode: Nevian records every order it sends as an order. To leave one out of revenue, open it in Logs › Conversions and click Mark as test (owners and admins).
  • An order carries the click ID when the buyer reached the store through a Nevian tracking link. Without the snippet, the click ID only reaches an order when WooCommerce's order attribution kept that tracking link's landing page; any other order is tied to its visit by the buyer's email and the order's UTMs.
  • Don't also send a purchase from your thank-you page: the order webhook is the sale.

Problems

"WooCommerce reached Nevian, but the call was rejected"

Usually the secret saved in Nevian isn't the one on the webhook, so the signature doesn't match. Copy the Secret again from the webhook in WooCommerce (all of it) and, on the Connection tab, click Replace, paste it and click Save. WooCommerce doesn't resend a refused order, so update that order again once it's fixed.

The webhook's status changed to Disabled

WooCommerce turns a webhook off after more than five failed deliveries in a row. Fix the cause (the whole URL in Delivery URL, the same secret on both sides), set Status back to Active and click Save webhook. WooCommerce keeps its own record under WooCommerce › Status › Logs, source webhooks-delivery.

"no matching click" on a real sale

The order reached Nevian without the click ID. Check that the script is on every page of the store and that the PHP snippet is active. The next order that comes through a Nevian tracking link then carries the click ID.

Orders counted twice

Another integration also sends the same orders, for example a checkout such as Adoorei that creates your WooCommerce orders. Connect only one of the two.

WooCommerce explains webhooks in its own webhooks documentation.

Still stuck? Chat with us on WhatsApp or write to contact@nevian.io.

Images are drawings of WooCommerce's and Nevian's screens, not screenshots; the real screen may look a little different.