Install on a custom site (universal snippet)
One script tag in the head works on any stack, from Next.js and Rails to static HTML, Framer, or HubSpot CMS, plus how to report conversions Luria can't detect on its own.
About 5 minutes
What you'll need
- A Luria account at luriart.com/app
- A way to edit the
<head>of your site (template, layout file, or your platform's custom code box) - Your Luria Site ID (Step 1)
This is the path for anything that isn't covered by a platform guide: Next.js, Rails, Django, Laravel, static HTML, headless Shopify storefronts, Framer, HubSpot CMS, Astro, anything that renders an HTML page. One snippet, one place.
Step 1: Copy your Site ID
Sign in at luriart.com/app and open Settings > Install. Copy the snippet. It is this tag with your ID in place of YOUR_SITE_ID:
<script async src="https://luriart.com/snippet.js" data-luria-site="YOUR_SITE_ID"></script>Step 2: Put the snippet in the head
Paste it inside <head>, before the closing </head> tag, on every page you want Luria to run on. In a framework, that means your root layout or base template so it ships on every route.
Minimal example of where it sits:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Your site</title>
<link rel="stylesheet" href="/styles.css" />
<script async src="https://luriart.com/snippet.js" data-luria-site="YOUR_SITE_ID"></script>
</head>
<body>
...
</body>
</html>Where that lives on common stacks:
| Stack | File or setting |
|---|---|
| Next.js (App Router) | app/layout.tsx, inside <head> |
| Next.js (Pages Router) | pages/_document.tsx, inside <Head> |
| Rails | app/views/layouts/application.html.erb |
| Static HTML | Every .html file, or your shared header include |
| Framer | Site Settings > General > Custom Code > Start of head tag |
| HubSpot CMS | Settings > Website > Pages > Site header HTML |
| Headless Shopify (Hydrogen and others) | Your root layout head |
Head placement matters. The snippet is async, so it won't slow the page, and loading it early is what keeps visitors from seeing a flash of the original content before Luria's version.
Step 3: Make sure conversions get counted
Luria auto-detects a conversion on any page whose URL contains /thank-you, /thank_you, or /orders/<id> (on non-Shopify sites). If your confirmation page matches one of those, you're done.
If it doesn't, or you want to pass a value, call the JavaScript API on the confirmation page:
window.luria.convert(goal, value)Purchase with an order value (in your store's currency):
<script>
window.luria && window.luria.convert("purchase", 129.00);
</script>Lead or signup with no value:
<script>
window.luria && window.luria.convert("lead");
</script>Put the call on the page the visitor lands on after completing the action, and make sure the Luria snippet is in that page's head too. The window.luria && guard keeps the page safe if the snippet is blocked. Full details, including every event Luria exposes, are in the JavaScript events reference.
Single-page apps
If your site changes routes without a full page load (React Router, Next.js client navigation, Vue Router), Luria watches for route changes and re-runs on each new route. Auto-detection of /thank-you URLs applies to those client-side routes as well. If in doubt, call window.luria.convert(...) from your confirmation component when it mounts; it's the most reliable path.
Step 4: Allow Luria in your Content Security Policy (if you have one)
If your site sends a Content-Security-Policy header, add Luria's host to script-src and connect-src:
script-src ... https://luriart.com;
connect-src ... https://luriart.com;Without this, the browser silently blocks the snippet and Luria fails open (your page is untouched, nothing is tracked). Most sites don't set a CSP; if you don't know whether yours does, you almost certainly don't.
Step 5: Verify
Deploy, open your site in a private window, and check the Luria dashboard for the "Tracking live" indicator, usually within about 60 seconds. Then run a test conversion and confirm it appears.
Full checklist: Verify your install.
Troubleshooting
Yes, but visitors may see the original page for a moment before Luria's version. Move it to <head> for the best experience.
Tag managers add a delay before the snippet loads, which can cause flicker and, in Preview mode, sometimes no load at all until you publish. A direct head install is better. If you must use one, follow Install with Google Tag Manager.
Some ad blockers block third-party scripts. For those visitors Luria fails open: they see your normal site, and no data is collected. This is expected and affects a small share of traffic. There is nothing to fix.
Two copies (for example one in your layout and one in a tag manager) can double-count sessions. Luria ignores the second copy when it can, but remove the duplicate to be safe.
Check the browser console for a blocked request to luriart.com (CSP or ad blocker), confirm the Site ID matches your dashboard exactly, and confirm the tag is in the deployed HTML (view source). Then see Snippet not firing.