Lightspeed

FAQ

Solutions to common questions and issues when using Clerk with Lightspeed

Running into issues with your Lightspeed integration? This FAQ covers the most common problems and their solutions, from formatters to sync errors.

Using formatters #

Clerk.js allows you to write custom JavaScript functions that add new functionality to your Designs.

Formatters can be added in two ways:

  • Through my.clerk.io > Developers > Formatters, where each Formatter can be created as separate entries.

  • As a configuration for Clerk.js, in the tracking-script that is inserted on all pages, where multiple formatters can be added at once.

Example formatter #

An example can be seen below. Please be aware this is Clerk V2 (latest version):

Clerk('config', {
  key: 'O7UITkJIXqXibeQF9ONobiGGKYYKtbvh',
  formatters: {
    log_price: function(price) {
      console.log(price);
    }
  }
});

Multiple formatters #

You can write any number of formatters, separated by comma, like this:

formatters: {
  log_price: function(price) {
    console.log(price);
  },
  calculate_discount: function(price, special_price) {
    return price - special_price;
  },
  substring: function(text) {
    var short_string = text.substring(0, 20);
    return short_string;
  }
}

Use in designs #

After creating your formatters, you can use them in Designs using this syntax:

Formatter syntax in designs

This allows you to create any functionality in your Designs that you’d like to use with Clerk in your webshop.

Common errors #

Clerk not defined #

If you see this error message, it means Clerk is not being defined in the website.

The most common cause for this is the Clerk tracking scripts not being implemented in the appropriate places.

Click here to view the implementation process for inserting both the Order Tracking and Visitor Tracking scripts.

API cooldown #

This message in the data sync logs is coming from the Lightspeed rate limit.

Lightspeed has set a low rate limit by default to manage the volume of data transmitted from their services.

Please note that this rate limit is not within Clerk’s control.

To address this, you have two options:

  1. Consider upgrading the rate limit service with Lightspeed.

  2. Alternatively, you may choose to wait for the synchronization process to complete.

429 Too Many Requests #

This error means that Lightspeed made too many requests in a given amount of time and exceeded its rate limit.

To address this, we suggest adjusting the page size under your data sync settings in my.clerk.io > Data > Configuration.