XeniaXenia Docs

Connect your website

PreviousNext

Add Xenia to a non-Shopify storefront so it can see visits, orders, and conversions.

If you are not on Shopify, you connect your site yourself. Everything you need is generated for you in the app, under Analytics, in the storefront setup panel. Copy what it gives you and hand it to whoever maintains your site.

What the setup panel gives you

ItemWhat it is for
Your workspace detailsIdentifies your workspace and environment on every request
Tracker snippetLets Xenia see visits, clicks, and landings
Order event exampleSends completed orders so revenue can be measured

Each environment has its own details, so your staging site must use the staging values and your live site the live ones.

Step 1: add the tracker

Paste the snippet from the setup panel before the closing </body> tag of your site. It looks like this, with your own values filled in:

<script src="https://<your-xenia-host>/xenia-tracker.iife.js"></script>
<script>
  XeniaTracker.init({
    url: "<the endpoint shown in the setup panel>",
    headers: {
      "X-Tenant-Id": "<your workspace id>",
      "X-Environment": "<your environment>",
    },
  });
</script>

Once it is in place, Xenia recognizes visitors arriving from journey links, so clicks and landings are credited to the journey that sent them.

Track things without writing JavaScript

Mark up the elements you care about. No code beyond the attribute is needed, and elements added later are picked up automatically.

<button data-xenia="checkout-btn&click">Checkout</button>
<section data-xenia="hero&view-port">Hero banner</section>
<div data-xenia="home&page-load"></div>
Second valueFires when
clickThe element is clicked
view-portThe element scrolls into view
page-loadThe page loads

Track in code

<script>
  // Fire a named event, with any extra details you want to keep
  XeniaTracker.track("add_to_cart", { product: "shoe-123", price: 49.99 });
 
  // Tell Xenia who this visitor is, once you know (after login or consent)
  XeniaTracker.identify("<your customer id>");
</script>

If you gate tracking behind a cookie banner, use the tracker's onBeforeTrigger option to hold events until consent is given, rather than loading the script conditionally. That way your markup keeps working either way.

Step 2: send your orders

The tracker covers browsing. Completed orders should be sent from your own backend, because that is the only place an order is certain. The setup panel shows the exact request, including where to send it and what to include.

Include, at minimum, the order value, the order reference, the currency, and the customer's email address.

Why identity matters

Xenia credits a sale to a journey in one of two ways: the shopper arrived through a journey link, which ties the sale to the exact message they clicked, or the order carries the same email or visitor the journey enrolled.

If an order carries neither, the revenue still counts, but nothing gets credit for it. Most "the journey shows no revenue" reports come down to this.

If your store already calls its order event something else, an Admin or Developer can map your names to Xenia's under Analytics, in the advanced conversion mapping panel. That is a settings change, not a code change.

Step 3: start journeys from your own systems

To start a journey when something happens in your stack, add a Webhook trigger to the journey. Selecting that node in the builder shows the address to call and the details it expects. Give that to your developer and point your system at it.

Next