Updating the Intelligems Script
The CommonJS script will remain supported for current features. However, new features will only be available with the ESM script, so we recommend updating your Script code as soon as you are able to. Additionally, the ESM script improves plugin performance, making it faster!
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):
Post-December 9, 2024 (ESM Script)
The updated script uses the following format (with abcdefghijk
replaced by your unique customer ID):
Key differences include:
type="module"
– the script is now a JavaScript module.esm
– the directory structure reflects the new ESM format.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:
Go to the settings page in the Intelligems app.
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.
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:theme.liquid
any other theme.*.liquid files (e.g., theme.gempages.liquid if you have this file)
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?