> For the complete documentation index, see [llms.txt](https://support.fibr.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.fibr.ai/get-started-with-fibr-ai/fibr-script/impact-of-fibr-script-using-gtm.md).

# Impact of Fibr Script using GTM

You can install the Fibr Script through Google Tag Manager, but we recommend against it. Here's why.

***

#### The Problem with GTM Installation

Google Tag Manager adds an extra layer between your page and the Fibr Script. This delay affects how quickly Fibr can initialize and deliver personalized experiences.

The result? Slower performance metrics and a higher chance of flickering, where visitors briefly see your original page before the personalized version loads.

***

#### Performance Comparison: Direct vs. GTM

We tested the same Fibr Script installed two ways: directly in the `<head>` tag versus through Google Tag Manager.

| Metric                         | Direct Installation | Via GTM | Performance Hit |
| ------------------------------ | ------------------- | ------- | --------------- |
| First Contentful Paint (FCP)   | 0.99s               | 1.15s   | +160ms (+16%)   |
| Largest Contentful Paint (LCP) | 2.21s               | 2.31s   | +100ms (+5%)    |
| Total Blocking Time (TBT)      | 587ms               | 726ms   | +139ms (+24%)   |

**GTM adds roughly 100-160ms of delay across key metrics.** That might not sound like much, but it's enough to cause visible flickering and can hurt your Core Web Vitals scores.

***

#### When GTM Might Be Acceptable

Direct installation is always the better choice, but we understand that some teams have constraints. GTM installation may be acceptable if:

* You don't have direct access to your site's HTML
* Your organization requires all scripts to go through GTM for governance reasons
* The pages you're personalizing aren't performance-critical (e.g., internal tools, low-traffic landing pages)

If you do use GTM, test thoroughly for flickering and monitor your Core Web Vitals after deployment.

***

#### Our Recommendation

**Install the Fibr Script directly in your `<head>` tag whenever possible.**

Place it at the very top, before analytics tags and other third-party scripts. This gives Fibr the best chance to load early and deliver experiences without delay.

Need help with direct installation? See our setup guides:

* [Configure Fibr Script for your website](/get-started-with-fibr-ai/fibr-script/configure-fibr-script-to-your-website.md)
* [Configure Fibr Script for Shopify](/get-started-with-fibr-ai/fibr-script/configuring-the-fibr-script-for-your-shopify-store.md)

If you're stuck with GTM and experiencing issues, reach out to us at <support@fibr.ai>. We can help you optimize your setup.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://support.fibr.ai/get-started-with-fibr-ai/fibr-script/impact-of-fibr-script-using-gtm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
