Improve Rebuy Smart Cart load speed
Shopify loads apps only after the main site has finished loading. This means Rebuy cannot run until the entire site is ready, which can delay features like Smart Cart, Merchandising Widgets, Smart Search, and Bundle Builder from rendering immediately. This loading sequence keeps third-party apps compatible and functioning correctly, but it inherently introduces a delay because apps load only after the theme's main files have finished. Mobile devices can experience the same delay for the same reason.
The sections below cover several methods to improve Rebuy's load times.
Install the Rebuy Script Tag and disable Rebuy JS (recommended)
The Install Rebuy Script Tag and Disable Rebuy JS setting is the recommended way to load Rebuy faster. It loads Rebuy through the Rebuy Connector App Embed with no theme code for you to maintain.
Step 1: Log in to the Rebuy Admin Portal.
Step 2: Go to the Settings tab on the left side of the admin portal.
Step 3: Select App Settings.
Step 4: Find the toggle labeled Install Rebuy Script Tag and Disable Rebuy JS and turn it on.
Step 5: Make sure that the "Enable Rebuy JS" toggle from the General Settings column is disabled so that Rebuy's scripts don't load in twice.
Warning: Do not disable Rebuy JS before the script is active on your theme, or Rebuy features will not load.
(Screenshot above: App Settings page with the "Install Rebuy Script Tag and Disable Rebuy JS" toggle highlighted)
This setting relies on the Rebuy Connector App Embed Block in Shopify. Confirm the Rebuy Connector is enabled on your live theme. Open your Shopify settings, go to Sales channels > Online Store, click Customize on your live theme, open App embeds in the left navigation, and confirm the Rebuy Connector is toggled on.
Note: The Rebuy Connector may already be enabled if it was set up during onboarding or when enabling another feature that requires it. Confirm it is on to be certain.
Run only one install method at a time. Activating both the Script Tag setting and the App Embed, or adding a manual script tag on top of either, loads Rebuy more than once and creates redundancy. To check for duplicates, search your theme files for manual Rebuy script tags and confirm only one method is active.
(Screenshot above: Rebuy Connector App Embed toggle in the Shopify theme editor)
Optimize how Rebuy loads in your theme (advanced)
For developers: The optimizations below require editing your theme's code (layout/theme.liquid and snippet files). Rebuy Support can guide you through these steps but cannot make theme-code changes on your behalf. If you are not comfortable editing theme files, share this section with your developer.
Loading the Rebuy script from your own theme takes Rebuy off the critical render path so widgets appear faster and your Largest Contentful Paint (LCP) improves. This is a developer alternative to the Install Rebuy Script Tag and Disable Rebuy JS toggle above. Use one method, not both. The steps below end with a single Rebuy load path, so complete them in order.
Before you start:
Work on an unpublished draft theme. Duplicate your live theme rather than editing it directly.
You will be working in the Rebuy admin under Settings > App Settings, plus your Shopify theme code.
Preview the draft theme on your live store domain, not localhost. Rebuy's SDK needs the real Shopify storefront context to initialize, so
shopify theme devor localhost will not render widgets.
Add the preconnect hints and async script in one snippet
Keeping the preconnect hints and the script tag in a single snippet means the connection setup and the script always load together in the right order, and you have one file to update whenever Rebuy's setup changes.
Step 1: Create the snippet. In your theme code editor, choose Snippets > Add a new snippet and name it rebuy-scripts.liquid then paste in this exact block and click Save:
{%- comment -%} Rebuy performance loader: preconnect + async script {%- endcomment -%}
<link rel="preconnect" href="https://rebuyengine.com" crossorigin>
<link rel="preconnect" href="https://cdn.rebuyengine.com" crossorigin>
<link rel="preconnect" href="https://cached.rebuyengine.com" crossorigin>
<script async src="https://cdn.rebuyengine.com/onsite/js/rebuy.js?shop={{ shop.permanent_domain }}"></script>(Screenshot above: Shopify theme code editor with a new rebuy-scripts.liquid snippet created inside the snippets folder)
What each line does:
The three preconnect links tell the browser to start opening a secure connection to Rebuy's servers (
rebuyengine.com,cdn.rebuyengine.com, andcached.rebuyengine.com) immediately, in parallel with the rest of the page. This shaves off how long the first widget takes to appear on a cold load.The
asyncscript line loads the Rebuy SDK without blocking the page from rendering, so your content paints while Rebuy downloads in the background.
Step 2: Call the snippet once, high in the head. Open layout/theme.liquid, find the opening <head> tag, and add this single line directly below the <meta charset> tag. The earlier it sits in the head, the sooner the browser starts connecting to Rebuy. Save the file.
{%- render 'rebuy-scripts' -%}That one render line is all you need. No other Rebuy <link> or <script> tags should be scattered elsewhere in the theme.
(Screenshot above: Shopify theme code editor with layout/theme.liquid open, showing {%- render 'rebuy-scripts' -%} added directly below the <meta charset> tag inside the <head>)
Switch off the duplicate load sources
Warning: Order matters. Confirm Rebuy still loads from your new snippet before you disable the other sources. Disabling them first will break all Rebuy features.
First, preview the draft theme and confirm all Rebuy widgets, recommendations, and Smart Cart still load and function. Once confirmed, disable the sources that would otherwise load Rebuy a second time so your admin matches this required state:
In Shopify: Theme > Customize > App embeds, turn off the Rebuy app embed.
In the Rebuy admin App Settings: set Install Rebuy Script Tag and Disable Rebuy JS to off and Enable Rebuy JS to off, then click Save.
(Screenshot above: App Settings in the Rebuy admin with "Install Rebuy Script Tag and Disable Rebuy JS" toggled off, "Enable Rebuy JS" toggled off)
After disabling those sources, re-verify that everything still works, then open your browser's Network tab and confirm there is now only one rebuy.js request. More than one request means Rebuy is still loading from a second source.
Prevent the widget pre-load flash
Rebuy widgets are Vue-based and can briefly show raw markup before they finish loading. To hide them until they are ready, add this <style> block to the same rebuy-scripts.liquid snippet, below the script line. Rendering it in the head this way applies the style before any widget appears:
<style>
/* Hide Rebuy widgets until they finish loading to prevent a flash of raw markup */
[v-cloak] { display: none !important; }
</style>
Reminder: Make these changes on an unpublished draft theme first, confirm everything works, and only then publish.
Remove jQuery to increase site speed
Disabling jQuery in Rebuy can improve load times if your store does not rely on it for custom code or templates. New merchants as of September 1st, 2025 have jQuery disabled by default. For more detail, see jQuery and How It Affects Your Store.
Step 1: Log in to the Rebuy Admin Portal.
Step 2: Go to the Settings tab on the left side of the admin portal.
Step 3: Select App Settings.
Step 4: Find the jQuery option and toggle it OFF.
(Screenshot above: App Settings page with the jQuery toggle highlighted and toggled OFF)
FAQs
How can I make Rebuy load faster on my store?
To make Rebuy load faster, turn on the Install Rebuy Script Tag and Disable Rebuy JS setting in the Rebuy admin portal. This loads Rebuy earlier in the page lifecycle through the Rebuy Connector App Embed and minimizes delays for features like Smart Cart and Smart Search. You can also disable jQuery if your store does not require it. To prevent conflicts, check your theme files for manual Rebuy script tags and confirm only one install method is active.
Should I use the admin toggle or a manual script tag to load Rebuy?
Use one method, not both. For most merchants, the Install Rebuy Script Tag and Disable Rebuy JS toggle in the Rebuy admin is the recommended path, since it loads Rebuy through the Rebuy Connector App Embed with no theme code to maintain. The manual script tag is an advanced alternative for developers who want to control exactly where and how Rebuy loads in the theme. Running both at once loads Rebuy twice and causes redundancy, so if you add the manual script tag, first turn off the admin toggle, set Enable Rebuy JS to No, and turn off the Rebuy Connector App Embed.
How do I switch from the Rebuy Connector to a manual script tag without downtime?
To switch from the Rebuy Connector to a manual script tag without interrupting Rebuy, add the new script before you turn off the old loading method, then land on the required end state:
Add the async Rebuy script tag directly to your theme file while your current setup is still active, and confirm Rebuy loads from it.
In the Rebuy admin App Settings, set Install Rebuy Script Tag and Disable Rebuy JS to off and Enable Rebuy JS to off, then click Save.
In your Shopify theme editor, turn off the Rebuy Connector App Embed.
The end state is both toggles off, the Rebuy Connector off, and your manual script tag loading Rebuy. Adding the manual script before you turn off the other methods means there is no downtime, and turning the toggles and Connector off afterward prevents Rebuy from loading twice.







