LuriaDocs
Install

Install on WooCommerce

Add the Luria snippet to your WooCommerce store with a header plugin or child theme, and report purchases from the order-received page.

plain textupdated 2026-08-19

About 10 minutes

What you'll need

  • A Luria account at luriart.com/app
  • WordPress admin access to your WooCommerce store
  • Either a header-scripts plugin (WPCode, also known as "Insert Headers and Footers") or a child theme you can edit
  • Your Luria Site ID (Step 1)

Step 1: Copy your Site ID

Sign in at luriart.com/app and open Settings > Install. Copy the snippet:

<script async src="https://luriart.com/snippet.js" data-luria-site="YOUR_SITE_ID"></script>

Step 2: Add the snippet to your site head

Pick one option. Option A is easier and survives theme updates.

Option A: WPCode (recommended)

  1. In WordPress, go to Plugins > Add New, search for "WPCode", install and activate it.
  2. Go to Code Snippets > Header & Footer.
  3. Paste the Luria snippet into the Header box.
  4. Click Save Changes.

Any similar plugin works (Insert Headers and Footers, Head & Footer Code, Site Kit's header field). Just make sure the box says "header" or "head", not "footer".

Option B: Child theme header.php

Only if you already use a child theme. Open Appearance > Theme File Editor > header.php (child theme), and paste the snippet on the line before </head>. Save. Don't edit the parent theme; the next update wipes it.

The WordPress Customizer's "Additional CSS" box is CSS only; it can't hold a script. You need a plugin or a child theme for head code.

Step 3: Report purchases from the order-received page

WooCommerce's thank-you page URL looks like /checkout/order-received/1234/. That does not match Luria's auto-detect patterns (/thank-you, /thank_you, /orders/<id>), so add one small hook that prints the conversion call with the order total.

Add this as a PHP snippet in WPCode (Code Snippets > Add Snippet > "Add Your Custom Code", type PHP, location "Run Everywhere"), or in your child theme's functions.php:

add_action( 'woocommerce_thankyou', function ( $order_id ) {
    $order = wc_get_order( $order_id );
    if ( ! $order ) {
        return;
    }
    $total = (float) $order->get_total();
    echo '<script>window.luria && window.luria.convert("purchase", ' . wp_json_encode( $total ) . ');</script>';
}, 10, 1 );

This fires once per order, on the page the customer lands on after paying. Value is the order total in your store currency. If you'd rather count every order as equal, replace the convert(...) line with window.luria.convert("purchase").

Step 4: Purge your cache

If you run a caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache) or host-level caching (WP Engine, Kinsta, SiteGround), clear it now. Otherwise visitors keep getting the old pages without the snippet for hours.

Also check that your optimizer isn't delaying or deferring third-party scripts. Look for settings like "Delay JavaScript execution" or "Defer JS" and exclude luriart.com. A delayed snippet causes flicker.

Step 5: Verify

Open your store in a private window. In the Luria dashboard, you should see "Tracking live" within about 60 seconds. Place a test order (a 100% coupon works) and confirm it shows as a purchase with the right value.

Full checklist: Verify your install.

Troubleshooting

Next steps

On this page