Adding Intelligems Script to your Theme
Last updated
Last updated
Adding the Intelligems script to your site is the most important step to getting started with testing with Intelligems! Adding the Intelligems script to your site is the only mandatory integration step for Content, Shipping and Campaigns testing, and is the first step to integrating for price testing. There are two options below for adding the Intelligems script to your site.
This is the preferred option for installing the Intelligems script!
To complete this, 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 paste the Intelligems Script as a source into 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)
If you are planning to run a theme test, you should also add our script to the Additional Scripts section for the Post-purchase page. 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".
This will need to be manually removed if you uninstall Intelligems.
This will load Intelligems async, which is not recommended in most cases because you may see a "flicker". Option 1 is the preferred method for limiting flicker.
For performance concerns, see our docs on performance optimization.
The fastest way to add Intelligems JavaScript to your theme is to enable it in the "Customize" section of your theme. You can do so by logging into your Shopify Admin, and navigating to Sales Channels > Online Store > Live theme - Customize > App Embeds. Search "Intelligems", make sure it is toggled on, and click "Save" in the top right.
If you are on Shopify Plus and are still using checkout.liquid, you will still need to manually add Intelligems JavaScript to your checkout.liquid file in order to hide the discount or preview bar at checkout. Your individual script tag is located on the settings page in the Intelligems App.
For any password protected store, we will not be able to automatically detect the script, so you will continue to get an error message in the app regarding the script not being in your theme.