# Install on WooCommerce
Source: https://docs.luriart.com/install/woocommerce
Plain text: https://docs.luriart.com/install/woocommerce.txt
Add the Luria snippet to your WooCommerce store with a header plugin or child theme, and report purchases from the order-received page.
Time needed: about 10 minutes.
## What you'll need
* A Luria account at [luriart.com/app](https://www.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](https://www.luriart.com/app) and open Settings > Install. Copy the snippet:
```html
```
[Screenshot: Luria dashboard Settings > Install page with the snippet and Site ID]
### 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.
[Screenshot: WPCode Header & Footer screen with the Luria snippet pasted into the Header field]
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 ``. Save. Don't edit the parent theme; the next update wipes it.
**Note:**
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/`), 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`:
```php
add_action( 'woocommerce_thankyou', function ( $order_id ) {
$order = wc_get_order( $order_id );
if ( ! $order ) {
return;
}
$total = (float) $order->get_total();
echo '';
}, 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")`.
[Screenshot: WPCode Add Snippet screen with the woocommerce_thankyou PHP snippet saved and active]
### 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](/install/verify-install).
## Troubleshooting
**Tracking shows live but orders aren't counted**
Check Step 3 is active and that the order-received page loads without a redirect to a custom thank-you page. If you use a custom thank-you page, add the convert call there instead (or name the URL `/thank-you` so it's auto-detected).
**The snippet isn't in my page source**
Clear caches (Step 4). Then view source on a product page and search for `luriart.com`. If it's missing, the plugin box or theme file isn't the one rendering the head; check your theme doesn't use a custom header template.
**My page optimizer broke the install**
Exclude `luriart.com/snippet.js` from delay, defer, minify, and combine. WP Rocket: Settings > File Optimization > Excluded JavaScript Files. LiteSpeed: Page Optimization > Tuning > JS Excludes.
**I edited header.php and lost it after an update**
You edited the parent theme. Use WPCode (Option A) or a child theme.
**Pages flicker before Luria's version shows**
Move the snippet to the header box (not footer), remove it from any "delay JS" list, and purge cache.
## Next steps
* [Verify your install](/install/verify-install)
* [Set your goal](/train/goals)
* [How to train Luria](/train/how-to-train)