Connect confirmed orders to LiftSell when you are ready to measure revenue
Your widgets, views, and clicks work without purchase tracking. For basic setup, use the widget installation guide. No checkout or thank-you page is needed for that step.
This guide covers the optional connection to confirmed order data. Shopify uses the LiftSell Purchase Tracking extension when available in your installed app. Other platforms need an integration that can run after an order is confirmed and after LiftSell has loaded. A developer may be needed. Revenue reporting depends on your LiftSell plan.
Before setting up optional purchase tracking:
Create a Site
Go to Sites → Add site and enter your store domain (e.g. myshop.myshopify.com, shop.mydomain.com). Complete domain verification if required.
Create at least one widget
Create an announcement bar, free shipping bar, sticky ATC, etc. Open the widget and copy its embed script (public key).
Connect confirmed order data
For a custom integration, your order confirmation flow must allow purchase tracking code. Shopify uses the extension described below instead. This access is not required for basic widget installation.
For custom integrations, load the widget script on pages where you display the widget, and in the supported order confirmation flow where you call the tracking API:
<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script>Recommended placements:
</body>_app via <Script>To attribute revenue to widgets, LiftSell must know when an order has been completed.
On your order success / thank-you page, call:
<script>
window.LiftSell?.trackPurchase({
order_id: "ORDER-12345", // unique order identifier
revenue: 49.90, // net order value (number, not string)
currency: "EUR", // optional, but recommended (e.g. USD, TRY)
});
</script>LiftSell will automatically:
Rules:
trackPurchase exactly once per ordertrackPurchase runs after the order is confirmedStep 1 – Embed Script
In your main HTML layout, add:
<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script>Step 2 – Purchase Event
On your order success / thank-you template:
<script>
window.LiftSell?.trackPurchase({
order_id: "{{ORDER_ID}}",
revenue: {{ORDER_TOTAL}},
currency: "{{ORDER_CURRENCY}}",
});
</script>Replace the placeholders with your templating variables (e.g. Blade, Twig, EJS, etc.).
First install LiftSell and enable its app embed in your theme editor, then click Save. This installs storefront widgets without editing theme files. Storefront installation does not require purchase tracking.
For optional purchase tracking, use the LiftSell Purchase Tracking extension, if it is available in your installed app:
If the extension is not listed, contact LiftSell support to check availability. You can continue using storefront widgets while this optional setup is pending.
Do not use legacy Additional scripts instructions. The current Shopify checkout uses extensions; see Shopify's upgrade guide.
Custom or headless storefronts need their own integration. Theme app embeds do not install widgets into a separate frontend.
4.3.1 Add the Embed Script
Option A – Theme header (header.php):
<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script>Place it before </head> or </body>.
Option B – Header/footer plugin:
Use any "Header & Footer Scripts" plugin and paste the same <script> into the global header section.
4.3.2 Track Purchases via WooCommerce Hook
Add this to functions.php (or a small custom plugin):
add_action('woocommerce_thankyou', function($order_id) {
if (!$order_id) return;
$order = wc_get_order($order_id);
if (!$order) return;
?>
<script>
window.LiftSell?.trackPurchase({
order_id: "<?php echo esc_js($order->get_order_number()); ?>",
revenue: <?php echo floatval($order->get_total()); ?>,
currency: "<?php echo esc_js($order->get_currency()); ?>",
});
</script>
<?php
});Notes:
get_order_number() returns the human-readable order number (e.g. #1001)get_total() returns the order total as a float (no esc_js() needed for numbers)Embed Script (Global)
In Next.js, for example in app/layout.tsx or _app.tsx:
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
strategy="afterInteractive"
/>
</body>
</html>
);
}Purchase Tracking (Order Confirmation Route)
In your order confirmation page / component:
import { useEffect } from "react";
export default function OrderSuccessPage({ order }) {
useEffect(() => {
if (typeof window !== "undefined") {
window.LiftSell?.trackPurchase({
order_id: order.id,
revenue: order.total,
currency: order.currency || "EUR",
});
}
}, [order?.id]);
return <div>Thank you for your order!</div>;
}The important part is that trackPurchase runs client-side after the order is confirmed.
These platforms typically offer:
Global Embed:
Paste the embed <script> into your site-wide custom code (usually head or footer).
Purchase Tracking:
In the checkout / order confirmation custom code area, add:
<script>
window.LiftSell?.trackPurchase({
order_id: "{{ORDER_ID}}", <!-- Use platform's variables -->
revenue: {{ORDER_TOTAL}},
currency: "{{ORDER_CURRENCY}}",
});
</script>Consult your platform's docs to find the correct order variables. For Wix, add the snippet to your Thank You / Order Confirmation page (via Velo or Custom Code) and replace the placeholders with real order ID, total, and currency from Wix Stores (e.g. from the order confirmation context or Velo APIs).
Once views, clicks and purchases are being tracked, LiftSell will:
session_idwidget_click eventwidget_viewwidget_metrics_daily, which powers:You can see these metrics on the Metrics tab on each widget, and in the Analytics section.
After basic widget installation works, validate the optional purchase integration:
widget_view event should be loggedwidget_click event should be loggedIf views / clicks appear but orders do not, double-check:
LiftSell is a first-party, self-hosted measurement script that helps you track widget performance and revenue attribution.
LiftSell collects anonymous data for measurement purposes:
Under GDPR, LiftSell operates under "legitimate interest" for conversion tracking and revenue attribution. This is a standard legal basis for analytics and measurement tools.
You should:
Important: LiftSell is a first-party script (hosted on your domain via embed). We do not use third-party tracking pixels or cookies.