Skip to main content

Site performance

How LoyaltyLion loads on your store, and the steps we take to keep it out of your page render path.

Written by Jason Leader

Site performance affects conversion, so we build LoyaltyLion to stay out of your store’s way, and we prioritize the parts of our platform your shoppers touch directly.

In particular:

  • We minimize our blocking impact on page render, loading resources in the background and keeping long-running tasks off the main thread. Your page render pipeline is never queued behind LoyaltyLion code.

  • We distribute our critical content through a global CDN, which cuts the latency between us and your customers on everything they touch: loading content, claiming rewards and referring friends.

  • We cache heavily, so a visitor’s browser makes fewer requests for content that rarely changes.

  • We follow the performance best practices Shopify publishes for apps.

FAQ

When opening a page, there is a number of LoyaltyLion script loads. Why is that?

When loading LL we split the solution up into smaller bundles - this helps to reduce the size of the network payload that we send. The first thing we call is the loader - this is what decides what assets need to be fetched, then we fetch those in smaller bundles which make up the whole app. It prevents us loading lots of unnecessary JavaScript.

Those smaller bundles they may go off and individually call further assets, between each call it leaves the page to load other resources, lessening the load on the network. Each of those bundles are "chunked" which causes even less load on the browser than one big payload being called & run.

Can I restrict LoyaltyLion's SDK to only certain pages?

We wouldn't recommend this, as several of our features depend on the SDK running across the whole store, including:

  • Referral tracking - when a referred customer shows up on the page, the SDK captures and stores their information. If the SDK isn't present on the landing page, that is is lost and the referral won't be tracked.

  • Email identification - our query parameter from loyalty emails identifies the customer on arrival. Without the SDK on that page, the identification doesn't happen and we don't track LL emails.

  • Notifications

  • Guest visitor tracking - the SDK generates and keeps a visitor id used to tie pre-login activity to a customer once they sign in.

  • Referral welcome popups - shown to referred visitors when they land on the site.

  • Simple components (for example points for product) - any data-lion-* elements on non-loyalty pages won't show unless the SDK is running

LoyaltyLion's elements take a really long time to load on the page, is there a way to improve it?

Our snippet-injected scripts are dynamically inserted, which means that browsers already load them asynchronously - they don't block page rendering or the DOMContentLoaded event.

If you're seeing them affect site speed, it's likely things downstream, like translations or customisations that are competing for bandwidth during page load rather than the initial script blocking the page. Our recommendation would be to check the Network tab or your site's Theme Editor for large files that might be taking a while to load.

Did this answer your question?