Skip to main content

Checkout Champ installation guide

How to install the Retention.com base, revenue tracking and Reclaim scripts across your Checkout Champ funnels.

This guide covers installing Retention.com on Checkout Champ (Konnektive) funnels — the base script, revenue tracking, and the Reclaim events.

The steps below use account-level Global Scripts rather than per-funnel Tracking Pixels, so one install covers every funnel on your domain and survives duplicated or split-tested pages.


Step 1: Add your funnel domain to Authorized Domains

From your Retention dashboard, go to Code Script > Authorized Domains > Edit domains, add the domain your funnels are served from (for example get.yourbrand.com) and click Save.

This step is not optional. On a domain that is not listed, the script will load and then do nothing — no collection, no events, and no error message. A root domain covers its subdomains, so yourbrand.com also covers get.yourbrand.com.


Step 2: Install the base script

1. From your Retention dashboard, click Code Script > View script, then click Copy code next to Collection.

2. In Checkout Champ, go to Settings > Global Scripts > Add New Script.

3. Configure it as follows:

  • Name: Retention Base Script

  • Domain: your funnel domain

  • Funnel: All

  • Page Type: All

  • Head Code: paste the base script

4. Save, then publish each funnel.

Leave out the geq.page() line. The Collection code you copied ends with a separate <script>geq.page()</script> line below the base snippet. Do not paste that line into Checkout Champ — paste only the base snippet above it.

On Checkout Champ, when a visitor is collected is governed by the collection rules on your Retention account. Including geq.page() would collect on every single page load and override those rules.

If you would rather scope the base script to a single funnel, the equivalent location is Funnel Settings > Tracking Pixels > Custom Tracking Code > Head Script. That field accepts <script> tags but no other HTML.


Step 3: Add the revenue tracking script

Revenue tracking reads the completed order from the page and reports it back to your dashboard. Add it as a second Global Script:

  • Name: Retention Revenue Tracking

  • Page Type: Thank You Page

  • Body Code: the snippet below

<script>
(function () {
  var tries = 0, MAX = 40;
  function money(v) {
    return parseFloat(String(v == null ? '' : v).replace(/[^0-9.]/g, '')) || 0;
  }
  var timer = setInterval(function () {
    tries++;
    if (typeof geq === 'undefined' || typeof geq.trackOrder !== 'function') {
      if (tries >= MAX) clearInterval(timer);
      return;
    }
    var raw;
    try { raw = sessionStorage.getItem('orderData'); } catch (e) { clearInterval(timer); return; }
    if (!raw) { if (tries >= MAX) clearInterval(timer); return; }
    var o;
    try { o = JSON.parse(raw); } catch (e) { clearInterval(timer); return; }
    clearInterval(timer);
    if (!o || !o.orderId) return;
    geq.trackOrder({
      order_number: o.orderId,
      order_id: o.vendorOrderId || '',
      order_amount: money(o.totalAmount),
      order_email: o.emailAddress || ''
    });
  }, 250);
})();
</script>

Place this on the Thank You page, not on upsell pages. Checkout Champ keeps the order in sessionStorage from checkout onward, so a script scoped to upsell pages will fire before the upsells are added and the order will be recorded at its pre-upsell total. Only the first report for an order is kept, so a later, correct total will not replace it.

If your funnel has a long upsell chain and you would rather capture buyers who leave before reaching the Thank You page, you can scope it to Upsell Page as well — just be aware the recorded total will be the earlier amount. Adding Thank You Page alongside it costs nothing and catches any route that skips the upsells.

Verify totalAmount on a real test order. Open your browser console on the Thank You page and run JSON.parse(sessionStorage.getItem('orderData')) to confirm the field names before you rely on the numbers.


Step 4: Add the Checkout Started Reclaim script

This passes a Checkout Started event to your email platform so you can trigger an abandonment flow. Add it as a third Global Script:

  • Name: Retention Checkout Started Reclaim

  • Page Type: Checkout Page

  • Body Code: the snippet below

createCheckoutAbandonmentPayload is Retention's standard payload builder — paste it as-is and do not modify it. Everything below it reads the Checkout Champ order summary and can be adjusted to suit your checkout.

<script>
(function () {
  var POLL_MS = 250, MAX_TRIES = 48, tries = 0, fired = false;
  function createCheckoutAbandonmentPayload(cartId, cartAmount, currency, lineItems, checkoutUrl) {
    return {
      cart_id: cartId || "",
      cart_amount: cartAmount || "",
      currency: currency || "",
      extra: {
        line_items: lineItems.map(function (item) {
          var lineItem = {};
          if (item.Quantity) lineItem.quantity = item.Quantity;
          if (item.RowTotal) lineItem.line_price = item.RowTotal;
          var product = {};
          if (item.ProductName) product.title = item.ProductName;
          if (item.ProductID) product.id = item.ProductID;
          if (item.ProductURL) product.url = item.ProductURL;
          if (item.ItemPrice) product.price = { amount: item.ItemPrice, currencyCode: currency || "" };
          if (item.SKU) product.sku = item.SKU;
          if (item.ImageURL) product.image = { src: item.ImageURL };
          if (Object.keys(product).length > 0) lineItem.product = product;
          return lineItem;
        }),
        checkout_url: checkoutUrl || ""
      }
    };
  }
  function money(t) { return parseFloat(String(t || '').replace(/[^0-9.]/g, '')) || 0; }
  function visible(el) { return !!(el && el.offsetParent !== null); }
  function cleanUrl() {
    return window.location.href.replace(/([?&])vge=true&?/, '$1').replace(/[?&]$/, '');
  }
  function buildLineItems() {
    return Array.prototype.slice.call(document.querySelectorAll('.cc-cart-row'))
      .filter(function (r) {
        if (!visible(r)) return false;
        var t = r.querySelector('.cc-cart-row-prod-title');
        var p = r.querySelector('.cc-cart-row-prod-price');
        if (!t || !p) return false;
        var title = (t.textContent || '').trim();
        return title && title !== 'Name' && money(p.textContent) > 0;
      })
      .map(function (r) {
        var qtyEl = r.querySelector('.cc-cart-prod-qty-bubble');
        var imgEl = r.querySelector('.cc-cart-row-img');
        var qty = parseInt((qtyEl && qtyEl.textContent || '1').replace(/\D/g, ''), 10) || 1;
        var price = money(r.querySelector('.cc-cart-row-prod-price').textContent);
        return {
          ProductName: r.querySelector('.cc-cart-row-prod-title').textContent.trim(),
          Quantity: qty,
          ItemPrice: price,
          RowTotal: String(price * qty),
          ProductURL: cleanUrl(),
          ImageURL: imgEl ? (imgEl.getAttribute('src') || '') : ''
        };
      });
  }
  function attempt() {
    if (fired) return true;
    if (typeof geq === 'undefined' || typeof geq.event !== 'function') return false;
    var pd = window.pageData;
    if (!pd || typeof pd.pageTypeId === 'undefined') return false;
    if (pd.pageTypeId !== 4) return true;
    try { if (sessionStorage.getItem('orderData')) return true; } catch (e) {}
    var lineItems = buildLineItems();
    if (!lineItems.length) return false;
    var gt = document.querySelector('.grandTotal');
    var cartAmount = gt ? money(gt.textContent) : lineItems.reduce(function (s, li) {
      return s + li.ItemPrice * li.Quantity;
    }, 0);
    if (!cartAmount) return false;
    fired = true;
    geq.event("Checkout Started Reclaim", createCheckoutAbandonmentPayload(
      pd.pageViewReferenceId, cartAmount, "USD", lineItems, cleanUrl()
    ));
    return true;
  }
  var timer = setInterval(function () {
    tries++;
    if (attempt() || tries >= MAX_TRIES) clearInterval(timer);
  }, POLL_MS);
})();
</script>

A few notes on why the snippet is written this way:

  • It polls instead of firing on page load. The order summary renders asynchronously, so a script that fires immediately finds an empty cart and sends nothing.

  • It waits for the base script. If the Reclaim script happens to run first, it retries rather than giving up.

  • It checks the page type itself. pageTypeId === 4 is the checkout page. This is a safety net in case the script is ever applied more broadly than intended.

  • It will not fire post-purchase. Checkout Champ writes orderData into sessionStorage once an order completes, so that check stops the event firing again on upsell pages.

  • It will not send an empty cart. If no priced line item has rendered, it keeps waiting rather than sending a blank event.

  • Currency is hardcoded to USD. Change it if you sell in another currency.

If you sell free or $0 line items (gift-with-purchase, for example), note that the builder above omits a price of exactly zero. Those items will still appear in the email, just without a price.


Step 5: Add Viewed Product and Add to Cart Reclaim (optional)

These two events power browse-abandonment and cart-abandonment flows. On Checkout Champ they both belong on your sales or advertorial pages, so a single Global Script covers them:

  • Name: Retention Viewed Product and Add to Cart Reclaim

  • Page Type: All (the snippet restricts itself to sales pages)

  • Body Code: the snippet below

You must fill in the product details yourself. Unlike a normal storefront, Checkout Champ sales pages carry no product data in the page — the offer is resolved from the funnel when the visitor clicks through. So the product name, price and image have to be written into the snippet.

If a funnel sells more than one offer, duplicate the Global Script per funnel and change the OFFER block in each.

<script>
(function () {
  var POLL_MS = 250, MAX_TRIES = 40, tries = 0, done = false;
  var OFFER = {
    productID: "REPLACE-WITH-YOUR-PRODUCT-ID",
    productName: "Replace with your product name",
    price: 0.00,
    imageURL: "https://yourbrand.com/path/to/product-image.jpg",
    brand: "Your Brand",
    url: window.location.href
  };
  function attempt() {
    if (done) return true;
    if (typeof geq === 'undefined' || typeof geq.event !== 'function') return false;
    var pd = window.pageData;
    if (!pd || typeof pd.pageTypeId === 'undefined') return false;
    if (pd.pageTypeId !== 2) return true;
    done = true;
    OFFER.url = window.location.href;
    geq.event('Viewed Product Reclaim', OFFER);
    var buttons = document.querySelectorAll('a.redirect_to_product');
    for (var i = 0; i < buttons.length; i++) {
      buttons[i].addEventListener('click', function () {
        if (typeof geq !== 'undefined' && typeof geq.addToCart === 'function') {
          geq.addToCart(OFFER);
        }
      });
    }
    return true;
  }
  var timer = setInterval(function () {
    tries++;
    if (attempt() || tries >= MAX_TRIES) clearInterval(timer);
  }, POLL_MS);
})();
</script>

How it behaves:

  • Viewed Product Reclaim fires once on page load, on sales and advertorial pages only (pageTypeId === 2).

  • Add to Cart Reclaim fires when the visitor clicks a buy button. Checkout Champ gives every buy button the class redirect_to_product, so the snippet attaches to all of them without you naming each one.

  • The two events are independent of one another, so firing Viewed Product on load will not prevent Add to Cart firing a moment later on the same page.

  • The fields in OFFER pass straight through to your email platform as event properties, so name them to match whatever your email templates expect.

Use geq.addToCart() or geq.event('Add to Cart Reclaim', ...), never both. They share a cooldown, so if you fire both only the first is recorded — and they are sent to different places, so they are not interchangeable. The snippet above uses geq.addToCart().

Sales pages, landing pages and advertorials all share pageTypeId === 2. If you want these events on your main sales page only, add a check on window.pageData.currentPage.urlSlug. Match on a prefix rather than an exact value — split-test variants append a suffix, so a page can appear as sales-page, sales-page-a or sales-page-v2.


Disclaimer

These scripts use the capabilities offered by Checkout Champ and are intended to be lightweight and perform well in most scenarios. Every funnel is different, so your team may need to adjust them — particularly the currency and any custom checkout layout.

Have questions? Message us on chat, or email us at support[at]retention.com!

Did this answer your question?