Lightspeed

Get Started

Install Clerk on Lightspeed following these easy steps

Get Clerk up and running on your Lightspeed store in just a few steps. This guide walks you through connecting your store, installing tracking scripts, and syncing your data.

Connecting your store #

After following these simple steps you will be able to see your Live Demo, which gives you a personal overview of how Clerk will work on your webshop, before setting up the rest of the system.

Add store #

After logging in to my.clerk.io, the first thing you need to do is add your store:

Add new store form
  1. Write the Name and Domain of your webshop.

  2. Choose Lightspeed as the Platform and choose your Currency.

  3. Click Add Store.

Install tracking scripts #

  1. In your Lightspeed backend, go to Settings > Website-Settings > Web Extras.

  2. Visitor tracking: Find the Custom JS box and insert the Clerk visitor tracking script.

    • Replace INSERT_PUBLIC_API_KEY with your Public Key from my.clerk.io > Developers > API Keys.
Tracking code box
  • If this doesn’t work, insert the script in the Tracking box instead.
<!-- Clerk.io Visitor Tracking (Lightspeed) -->
<script type="text/javascript">
  (function(w,d){
    var e=d.createElement('script'); e.type='text/javascript'; e.async=true;
    e.src='https://cdn.clerk.io/clerk.js';
    var s=d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e,s);
    w.__clerk_q=w.__clerk_q||[]; w.Clerk=w.Clerk||function(){w.__clerk_q.push(arguments)};
  })(window,document);

  Clerk('config', {
    key: 'INSERT_PUBLIC_API_KEY',
    formatters: {
      convert_currency: function(price) {
        const rate_raw = '{{ 100 | money }}'.replace(/[^0-9.]/g, '');
        const rate = parseFloat(rate_raw) ? (parseFloat(rate_raw) / 100) : 1;
        return rate * price;
      }
    },
    globals: {
      currency_iso: '{{ shop.currency2.code }}',
      currency_symbol: '{{ shop.currency2.symbol }}'
    }
  });

  {% if page.account.email %}
  Clerk('call', 'log/email', { email: '{{ page.account.email }}' });
  {% endif %}
</script>
  1. Order tracking: In the same page, find the Tracking box and insert the Clerk order tracking code below the visitor script.
Sales tracking code
<span
  class="clerk"
  data-api="log/sale"
  data-sale="{{ order.information.number }}"
  data-email="{{ order.customer.email }}"
  data-customer="{{ order.customer.id }}"
  data-products='[{% for product in order.products %}{"id":{{ product.product_id }},"quantity":{{ product.quantity }},"price":{{ product.base_price_incl }}}{% if not loop.last %},{% endif %}{% endfor %}]'>
</span>
  1. Click Save.

Sync data #

  1. Go to my.clerk.io > Data > Configuration.

  2. Enter the following information for your Lightspeed store:

    • Domain: Your webshop URL (for example, https://www.beautifulshop.nl/).

    • Cluster ID: See Lightspeed’s Server Clusters documentation (choose the cluster for your region, e.g. https://api.webshopapp.com/nl for NL).

    • API Key and API Secret: Contact Lightspeed Support to have these generated for your store.

    • Language (optional): Use codes like en or nl for multi-language setups.

  3. Insert the details into the importer fields. Optional advanced settings can be left as they are.

Data sync configuration
  1. Click Start Sync and wait for the sync to complete.