LuriaDocs
Install

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.

plain textupdated 2026-08-19

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:

StackFile or setting
Next.js (App Router)app/layout.tsx, inside <head>
Next.js (Pages Router)pages/_document.tsx, inside <Head>
Railsapp/views/layouts/application.html.erb
Static HTMLEvery .html file, or your shared header include
FramerSite Settings > General > Custom Code > Start of head tag
HubSpot CMSSettings > 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

Next steps

On this page