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.
Setting up a website is a developer task. Everything else in Xenia is done in the app, and none of it requires code.
Each environment has its own details, so your staging site must use the staging values and your live site the live ones.
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.
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><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>A journey listening for add_to_cart will never fire for addToCart. Whoever
builds the journey and whoever adds the tracking need to agree on the names once,
then keep them stable.
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.
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.
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.
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.
A trigger only starts a journey that is published and live. A journey still in draft accepts nothing, which is the usual reason a setup that worked while testing appears to do nothing later.