Updating the Intelligems Script

Context

Historically, Intelligems utilized a version of its script known as the CommonJS script. In December 2024, an update was released, transitioning to a new and improved version called the ESM script.

Here’s how the scripts differ:

Pre-December 9, 2024 (CommonJS Script)

The final line of the script looks like this (with abcdefghijk replaced by your unique customer ID):

<script src="https://cdn.intelligems.io/abcdefghijk.js"></script>

Post-December 9, 2024 (ESM Script)

The updated script uses the following format (with abcdefghijk replaced by your unique customer ID):

<script type="module" src="https://cdn.intelligems.io/esm/abcdefghijk/bundle.js"></script>

Key differences include:

  1. type="module" – the script is now a JavaScript module.

  2. esm – the directory structure reflects the new ESM format.

  3. bundle – the updated structure for improved performance.

The first eight lines of the script remain unchanged.

Required Changes

If you are seeing the below error in your Intelligems app:

This means you need to update your theme code to reflect the new ESM Script. Here are the steps to do so:

  1. Go to the settings page in the Intelligems app.

  2. Once there, you'll see a section called "Theme Script". Click the blue button in that block that says "Copy Script". This will copy your unique Intelligems script to your clipboard.

  3. Now head over to your Shopify account, and replace your current Intelligems Script with your new one. The script should be included as a source in the <head> of each of these files:

    1. theme.liquid

    2. any other theme.*.liquid files (e.g., theme.gempages.liquid if you have this file)

    3. checkout.liquid (if you have this file; most themes do not)

Here is a video walking through those steps:

Post-Purchase Page for Theme Tests

If you are planning to run a theme test, you should also update your script in the Additional Scripts section for the Post-purchase page if you are using this. This will hide the theme preview bar from showing up on your thank you page. You can get to the Additional Scripts section pictured below by going to Settings -> Checkout -> Scroll about halfway down to "Post-purchase page".

Last updated

Was this helpful?