# Install on WooCommerce Source: https://www.luriart.com/docs/install/woocommerce Plain text: https://www.luriart.com/docs/install/woocommerce.txt Put the Luria tag in your store's head with a code plugin, then count purchases on the WooCommerce order-received page. Time needed: about 10 minutes. Two things to do. The tag goes in the `` of every page. The purchase is counted on the order-received page, which Luria does not recognise on its own, so you add one hook there. ## What you'll need * Your Luria tag, with your site ID already filled in. Luria gives you the tag during onboarding, or by email from [hello@luriart.com](mailto:hello@luriart.com). The dashboard does not show the site ID yet. * WordPress admin access to the store * A code plugin such as WPCode (formerly Insert Headers and Footers), or a child theme you can edit ## Steps ### Step 1: Put the tag in the head In WordPress: **Plugins → Add New**, install and activate WPCode, then open **Code Snippets → Header & Footer**. Paste the tag into the **Header** box and click **Save Changes**. ```html ``` On a classic theme you can instead paste it into **Appearance → Theme File Editor → header.php**, just above ``, in a child theme. Block themes (the default themes since WordPress 5.9) have no header.php, so use the plugin. Head only. In the footer or the body, the tag still loads, but variants apply after the page has already painted. [Screenshot: WordPress admin, WPCode Header and Footer screen with the Luria script tag pasted in the Header box] ### Step 2: Count the purchase on the order-received page WooCommerce sends every paid order to `/checkout/order-received//`. That is not one of the paths Luria detects on its own (`/thank-you`, `/thank_you`, `/orders/`), so add the conversion call with the `woocommerce_thankyou` hook. In WPCode: **Code Snippets → Add Snippet → Add Your Custom Code**, choose **PHP Snippet**, paste this, set it to run everywhere, then **Save and Activate**. A child theme's `functions.php` works just as well. ```php add_action( 'woocommerce_thankyou', function ( $order_id ) { $order = wc_get_order( $order_id ); if ( ! $order ) { return; } ?> ` until you purge them. Purge, then reload your home page. ## Verify it worked 1. Open your store in a private window with ad blockers off. If you are in the EU, UK or Switzerland, Luria shows a small consent banner; click **Accept**, since nothing is tracked before you answer it. 2. View the page source. The tag is inside `` and your site ID is in it, not `YOUR_SITE_ID`. 3. In the browser's Network tab, look for a request to `luriart.com/api/events`. Events are batched, so give it a couple of seconds. 4. Place a test order. On [luriart.com/app](https://www.luriart.com/app), the Overview card "Conversions this period" goes up by one, and the Customers tab lists that session with its source and value. [Screenshot: Luria dashboard Customers tab listing converted sessions with source, first seen and value] Full checklist: [Verify your install](/install/verify). ## Common failures * **Nothing tracked at all.** The tag is missing its site ID, or the ID has a typo. Without a valid `data-luria-site` the snippet stops immediately. * **Tag not on the page.** A caching plugin is still serving the old head, or you pasted into the Footer box. Purge, then check the source again. * **Nothing counted after an order.** The PHP snippet is inactive, limited to certain pages, or the store uses a custom thank-you page that does not fire `woocommerce_thankyou`. Test with a real order, not a preview. * **Counted twice.** The hook is registered twice (plugin and `functions.php`), or you also call `window.luria.convert` in a page template. Keep one call per order. See [Duplicates](/troubleshooting/duplicates). * **Nothing in the test browser.** Global Privacy Control or Do Not Track is on, or you clicked Decline on the banner earlier. Luria collects nothing in both cases. Clear the site data and try again. * **Blocked by your own site.** A Content Security Policy that does not allow `luriart.com` stops the script. Add it to `script-src` and `connect-src`. ## Next steps - [Verify your install](/install/verify) - [JavaScript events](/reference/javascript-events) - [Snippet not firing](/troubleshooting/snippet-not-firing) - [Orders missing](/troubleshooting/orders-missing)