Install on WooCommerce
Put the Luria tag in your store's head with a code plugin, then count purchases on the WooCommerce order-received page.
About 10 minutes
Two things to do. The tag goes in the <head> 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. 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.
<script async src="https://luriart.com/snippet.js" data-luria-site="YOUR_SITE_ID"></script>On a classic theme you can instead paste it into Appearance → Theme File Editor → header.php, just above </head>, 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.
Step 2: Count the purchase on the order-received page
WooCommerce sends every paid order to /checkout/order-received/<id>/. That is not one of the paths Luria detects on its own (/thank-you, /thank_you, /orders/<id>), 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.
add_action( 'woocommerce_thankyou', function ( $order_id ) {
$order = wc_get_order( $order_id );
if ( ! $order ) { return; }
?>
<script>
(function go(n) {
if (window.luria) {
var k = "luria_wc_<?php echo esc_js( $order_id ); ?>";
if (!localStorage.getItem(k)) {
localStorage.setItem(k, "1");
window.luria.convert("purchase", <?php echo (float) $order->get_total(); ?>);
}
return;
}
if (n < 50) { setTimeout(function () { go(n + 1); }, 200); }
})(0);
</script>
<?php
} );The tag loads in the background, so the call waits for it, up to about ten seconds. The localStorage key keeps a customer who reloads the page from being counted twice.
Classic checkout and the newer checkout block both land on the order-received page, so the hook fires either way.
Step 3: Clear your cache
WP Rocket, LiteSpeed Cache, WP Super Cache and your host's own cache all serve the old <head> until you purge them. Purge, then reload your home page.
Verify it worked
- 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.
- View the page source. The tag is inside
<head>and your site ID is in it, notYOUR_SITE_ID. - 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. - Place a test order. On 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.

Full checklist: Verify your install.
Common failures
- Nothing tracked at all. The tag is missing its site ID, or the ID has a typo. Without a valid
data-luria-sitethe 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 callwindow.luria.convertin a page template. Keep one call per order. See 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.comstops the script. Add it toscript-srcandconnect-src.