> For the complete documentation index, see [llms.txt](https://docs.intelligems.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intelligems.io/performance-optimization/site-performance/anti-flicker-modes.md).

# Anti-Flicker Modes

Intelligems adds an anti-flicker functionality to reduce the performance impacts of our JavaScript by default. Therefore, please do not `async` or `defer` your Intelligems script; this is handled internally and will cause flashing on your site if added.

***

#### How anti-flicker works

Anti-flicker is on by default, and there's nothing to install or configure.

* **Price, content, and image tests:** Intelligems temporarily hides only the elements your experience changes, then shows them once the right version is applied. The rest of your page loads as normal.
* **Redirect tests (theme, template, and URL):** Intelligems hides the page during the redirect, so visitors don't see the original page before landing on the new one.

{% hint style="info" %}
**Install through the App Embed.** Our flicker improvements ship to the App Embed. If Intelligems is installed manually in your theme files, those improvements won't reach your store. [Reach out to our support team](https://portal.usepylon.com/intelligems/forms/intelligems-support-request) if you'd like help switching.
{% endhint %}

{% hint style="warning" %}
**We no longer recommend `window.igSettings.hideBody`.** Earlier versions of this page suggested adding a `hideBody: true` snippet to hide the whole page while Intelligems loads. Redirect tests already do this automatically, and it doesn't reduce flicker on price, content, or image tests. If you added this snippet, [reach out to our support team](https://portal.usepylon.com/intelligems/forms/intelligems-support-request) before removing it and we'll confirm the right setup for your store.
{% endhint %}

***

#### Third-Party Page Builders (GemPages, Shogun, PageFly, etc.)

If your store uses a third-party page builder, your landing pages may render through a **separate layout file** instead of `theme.liquid`. For example, GemPages typically uses `theme.gempages.liquid`.

If the Intelligems script is only installed in `theme.liquid`, it **will not load** on pages built with your page builder. This means redirects won't fire, anti-flicker won't activate, and tests won't run on those pages.

**To fix this:** Add the same full Intelligems code block to your page builder's layout file. For GemPages, look for `theme.gempages.liquid` in the **Layout** folder of your Shopify theme code editor. Place the block at the top of `<head>`, just like in `theme.liquid`.

**To verify the script is loading on a page:** Open the page in your browser, go to DevTools (right-click → Inspect → Elements), and search for `intelligems` or `cdn.intelligems.io`. If nothing appears, the script isn't installed in that page's layout file.

***

### My Site is Still Flickering

Flicker shows up most on slow connections and older mobile devices, so a page that looks clean on your desktop isn't a reliable test. It's also more likely on stores running a lot of third-party apps and scripts, since they compete with Intelligems to load. Removing apps you no longer use helps both flicker and site speed.

If you're still seeing flicker, please [reach out to our support team](https://portal.usepylon.com/intelligems/forms/intelligems-support-request). We have several internal tools we can use to help reduce flickering.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.intelligems.io/performance-optimization/site-performance/anti-flicker-modes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
