LuriaDocs
Install

Luria's API surface

The JavaScript calls the Luria tag exposes, the server key for sending conversions from your own backend, and how to test an install without touching your results.

plain textupdated 2026-10-03

Luria has two surfaces. On the page, the tag creates window.luria: record a goal, a funnel step, or who the visitor is. On your server, one endpoint takes the same goals with a per-site server key, for purchases and sign-ups your backend sees first.

Everything else (/api/patches, /api/consent, the collectors) is internal and changes without notice. Do not call it.

What you'll need

  • The Luria tag on the pages you want to measure (Install on a custom site), or your store's Luria app on Shopify (Install on Shopify)
  • For server events only: your site ID and server key, which Luria sends you on request (hello@luriart.com). The server key is a secret: never put it in page code

Steps

Step 1: Load the tag, with the queue line

<script>window.luria=window.luria||function(){(luria.q=luria.q||[]).push(arguments)}</script>
<script async src="https://luriart.com/snippet.js" data-luria-site="YOUR_SITE_ID"></script>

Put both in <head>. The first line is optional: it lets you call luria(...) before the tag has loaded, and the calls run once it has. Without it, guard every call with if (window.luria).

Two optional attributes on the tag switch on extras:

  • data-luria-spa: one page view per route change on single-page apps (React Router, Next.js client navigation, Vue Router). Query-only changes are not new pages.
  • data-luria-carriers: stamps the visitor's session ID onto Stripe Payment Links (client_reference_id), Calendly links and inline embeds (utm_content), Typeform links and embeds (hidden field luria_sid) and any form input named luria_sid. That is how a payment, booking or form answer that reaches Luria later by webhook credits the version this visitor saw. A value you set yourself is never overwritten.

Step 2: Record your goal

luria("goal", "purchase", { value: 129.0, currency: "USD", id: "ORDER-1042" });
luria("goal", "lead");

A goal counts as a conversion only when it is your site's main goal (sales, leads, booked calls, app installs). Any other name is kept as a funnel step and never moves a test. Aliases work: call_booked, optin, closed_won, webinar_registered and friends map to the goal they mean.

Pass the order or booking id whenever you have one. A reload, a second call, or your server reporting the same order all land on one conversion, and the server's amount wins.

On Shopify the order webhook is the one purchase source: a goal call there is recorded as a step. The older luria.convert("purchase", 129) still works everywhere.

Step 3: Mark funnel steps

luria("track", "add_to_cart", { sku: "TEE-BLK-M" });
luria("track", "begin_checkout");
luria("track", "pricing_view");

Names are letters, digits and _ . : -, up to 60 characters. Properties are kept flat: up to 12 keys with string, number or true/false values. Steps feed your funnel view; they are never a test result.

Step 4: Tell Luria who the visitor is (optional)

luria("identify", { email: "jane@example.com", phone: "+14155550100", userId: "u_829" });

The tag hashes each value (SHA-256) in the visitor's browser before anything is sent; the plain email, phone or user ID never leaves the page. Emails are trimmed and lowercased. Phones must be in international format (+ and country code), otherwise they are skipped rather than guessed.

This is what lets a lead or sale that arrives days later from your CRM or payment provider, carrying only an email, credit the version the visitor saw.

Step 5: Send conversions from your server (optional)

curl -X POST https://luriart.com/api/events \
  -H "content-type: application/json" \
  -H "x-luria-key: YOUR_SERVER_KEY" \
  -d '{"site":"YOUR_SITE_ID","session":"VISITOR_SESSION_ID","events":[{"id":"ORDER-1042","type":"goal","goal":"purchase","value":129,"currency":"USD","order_id":"ORDER-1042"}]}'

session is the visitor's session ID: the luria_sid value your form, Stripe client_reference_id or Calendly utm_content carried back (Step 1, data-luria-carriers). With the server key you may send goal, conversion and identify items without a browser origin; exposure and link_visit items are refused with a 403, and the server key adds nothing for other types. Identify items take hex SHA-256 hashes: {"id":"...","type":"identify","email_hash":"<sha256 of the trimmed, lowercased email>"}.

Step 6: Leave exposure alone

window.luria.exposure(test, arm) is what the tag calls when it shows a version. Calling it yourself with invented values corrupts the numbers the engine promotes and stops tests on.

Verify it worked

  1. Open any page with the tag and ?luria_test=check1 on the URL, in a private window with blockers off. Accept the consent banner if one appears. Luria records one install check for check1 and suppresses every exposure and conversion on that page, so testing never touches your results.
  2. Add ?luria_debug=1 to see each event the tag sends in the browser console.
  3. Type luria in the console: it should be a function with track, goal, identify and convert on it.
  4. Trigger a real goal, then check the Customers count in the Customers section of the dashboard Overview.

Full checklist: Verify your install.

Common failures

  • luria is not defined. The tag is async and you skipped the queue line in Step 1. Add it, or guard the call.
  • Nothing happens at all. By design under Global Privacy Control, Do Not Track or a declined consent banner. Queued calls simply never run.
  • A goal shows as a step, not a conversion. It is not your site's main goal, or the site is on Shopify. Check the goal set for your site.
  • Conversions refused from the browser. Goals, exposures and identify calls are accepted only from your registered site domain or its subdomains.
  • 403 from your server. Wrong server key, a key for another site, or the batch contains an exposure or link_visit item.
  • A Calendly or Typeform embed has no session ID. Their embed script reads its settings once, when it starts, which can be before the Luria tag runs. Use a Calendly or Typeform link where you can; links are stamped at the moment of the click.

Next steps

On this page