Complete guide to install LiftSell and track purchases for revenue attribution
LiftSell works on any website where you can:
<script> tag (the embed snippet), andOnce installed, LiftSell tracks:
and attributes revenue back to the widgets that actually influenced the sale.
Before installing LiftSell on any platform:
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).
Ensure thank-you page access
Make sure your store has a thank-you / order success page where you can inject custom scripts.
The embed script must be loaded on all public pages, especially:
<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script>Recommended placements:
</body>_app via <Script>Note: You can embed multiple widgets on the same site. Each widget has its own ls_... public key, but they all share the same tracking + attribution system.
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.).
4.2.1 Add the Embed Script (Theme-wide)
theme.liquid (or your main layout file)</body>:<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script>This loads LiftSell on all storefront pages (homepage, product pages, cart).
4.2.2 Track Purchases on the Order Status Page
The Order status page is a separate Shopify-hosted page and does not load your theme. You must add both the embed script and the trackPurchase snippet in the same place:
<script
src="https://www.liftsell.com/embed/ls_YOUR_PUBLIC_KEY"
async
></script><script>
window.LiftSell?.trackPurchase({
order_id: "{{ order.order_number }}",
revenue: {{ order.total_price | divided_by: 100.0 }},
currency: "{{ order.currency_code }}",
});
</script>Important: If you only add the trackPurchase snippet, window.LiftSell will be undefined on the Order status page and tracking will not run. Always include the embed script there as well.
Notes:
order.order_number is the order number (e.g. 1001)order.total_price is in cents in Shopify; divided_by: 100.0 converts it to a decimal (e.g. 4990 → 49.90)order.currency_code is the ISO currency code (e.g. USD, EUR)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.
To confirm everything works:
trackPurchase snippet for your platformwidget_view event should be loggedwidget_click event should be loggedtrackPurchase snippet should run onceIf views / clicks appear but orders do not, double-check:
trackPurchaseLiftSell 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.