# Install on a custom site (universal snippet) Source: https://docs.luriart.com/install/custom-site Plain text: https://docs.luriart.com/install/custom-site.txt 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. Time needed: about 5 minutes. ## What you'll need * A Luria account at [luriart.com/app](https://www.luriart.com/app) * A way to edit the `` 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](https://www.luriart.com/app) and open Settings > Install. Copy the snippet. It is this tag with your ID in place of `YOUR_SITE_ID`: ```html ``` [Screenshot: Luria dashboard Settings > Install page showing the universal snippet and Site ID] ### Step 2: Put the snippet in the head Paste it inside ``, before the closing `` 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: ```html Your site ... ``` Where that lives on common stacks: | Stack | File or setting | | -------------------------------------- | --------------------------------------------------------- | | Next.js (App Router) | `app/layout.tsx`, inside `` | | Next.js (Pages Router) | `pages/_document.tsx`, inside `` | | 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. [Screenshot: Code editor showing a root layout file with the Luria script tag placed inside the head element] ### Step 3: Make sure conversions get counted Luria auto-detects a conversion on any page whose URL contains `/thank-you`, `/thank_you`, or `/orders/` (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: ```js window.luria.convert(goal, value) ``` Purchase with an order value (in your store's currency): ```html ``` Lead or signup with no value: ```html ``` 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](/reference/javascript-events). **Note:** 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](/install/verify-install). ## Troubleshooting **I put the tag in the body. Does it still work?** Yes, but visitors may see the original page for a moment before Luria's version. Move it to `` for the best experience. **I installed through a tag manager and the dashboard is slow to show tracking** 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](/install/google-tag-manager). **Ad blockers** 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. **I have the snippet installed twice** 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. **The dashboard never shows tracking** 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](/troubleshooting/snippet-not-firing). ## Next steps * [Verify your install](/install/verify-install) * [Set your goal](/train/goals) * [How to train Luria](/train/how-to-train) * [JavaScript events reference](/reference/javascript-events)