Getting Started5 min read

WooCommerce Plugin

Install the official plugin to load the SDK and auto-track the WooCommerce commerce funnel, including revenue.

Browse docs

WooCommerce Plugin

Install the official Otter plugin to load the SDK and automatically track your WooCommerce commerce funnel — including purchases with revenue — without touching your theme.

Shopify gives Otter a native pixel that reports completed orders with structured data. The WooCommerce plugin brings WooCommerce to the same level: it injects the Otter SDK in your site's <head> with anti-flicker, and tracks product views, searches, add-to-cart, checkout starts, and purchases for you. Order data (total, currency, line items) comes straight from WooCommerce in PHP — not scraped from the page — so your revenue numbers are exact.

Because the WooCommerce thank-you page is on your own domain, the visitor's first-party optimo_uuid cookie is available there, so each purchase is attributed to the variant that visitor saw. Revenue is deduplicated by order id, so a refreshed confirmation page never double-counts a sale.

  1. 1

    Download the plugin

    On your project's installation page, open the WooCommerce guide and click Download the WooCommerce plugin.
  2. 2

    Upload and activate

    In WordPress admin go to Plugins → Add New → Upload Plugin, choose the zip, click Install Now, then Activate.
  3. 3

    Paste your API key

    Open Settings → Otter A/B Testing, paste your project API key, and save. The SDK starts loading immediately.
  4. 4

    Verify

    Place a test order if you can, then click Verify Installation on your Otter project page. You should see commerce events arrive.

Events tracked automatically

ViewContentProduct page viewed
SearchSearch submitted
AddToCartProduct added to cart
InitiateCheckoutCheckout started
PurchaseOrder completed (with revenue)

Configure a goal against any of these event names to score it. To score revenue, add a Revenue goal with the event name Purchase — see the Goals and Revenue & Currency guides.

Under the hood, the plugin calls the SDK with the order data on the thank-you page — equivalent to:

optimo.revenue({
  value: 129.0,
  currency: 'USD',
  order_id: '1042',
  quantity: 2,
})

WooCommerce tips

Remove any old snippet. The plugin injects the SDK for you. If you were loading Otter via a header plugin or theme edit, delete that so the SDK isn't loaded twice.

It works without WooCommerce too. The SDK loads on any WordPress site for A/B testing; the commerce events switch on automatically when WooCommerce is active.

Toggles live in settings. Anti-flicker, commerce events, and sending the customer email on purchase can each be turned off under Settings → Otter A/B Testing.

Frequently asked questions

Quick answers to the questions teams ask most about this part of Otter.