> For the full index of Sherpa pages for agents, see https://www.withsherpa.ai/llms.txt

URL: https://www.withsherpa.ai/docs/scripts-and-pixels
Title: Scripts and pixels | Sherpa Docs
Description: Add a tracking script, chat widget or ad pixel to your website.

[Docs](https://www.withsherpa.ai/docs) Forms and integrations

# Scripts and pixels

Add a tracking script, chat widget or ad pixel to your website.

Ad pixels, chat widgets and analytics tags all arrive as a snippet someone has to paste into the right place. Give it to your agent and it adds it properly, on the pages you name, loaded so it does not slow your site down. It can also tell you what is already installed, which is usually more than anyone remembers.

## See it in action

Ask your agent this.

> Add the tracking snippet below to every page of my website. Load it after the page is ready so it does not slow anything down, and tell me how to confirm it is working.

It answers with something like this.

The snippet is on every page and loads after the page is ready.

To confirm it, open the preview, then look for a new visit in the tool's live view. It should show within a minute.

## What happens

1. You paste the snippet from the tool you are adding.

2. Your agent adds it to the website's shared layout so it runs on every page.

3. It builds a preview. You check the tool is receiving data.

4. You publish.

## What to check

- The tool reports events from the preview or the live site.

- Page speed did not get noticeably worse.

## What you can add

- Analytics and product tools such as PostHog or Google Analytics

- Ad pixels such as Meta, LinkedIn and Google Ads

- Chat widgets and schedulers

- Consent banners

- Anything else that gives you a snippet to paste

## Good to know

### Only some pages

Say which pages. **Only on /pricing and /demo** works.

### You may not need one

Sherpa already records visits, clicks, scrolling and bookings on every page. Before adding another analytics script, see [Read your analytics](https://www.withsherpa.ai/docs/analytics-overview).

### Keep a list

Ask your agent which third-party scripts the website loads. Remove the ones you no longer use. Every script costs load time.

**Pro tip**

Ask for an audit of your pixels and scripts, especially after a migration. Your agent can compare the new site with the old one and tell you what is missing or duplicated.

## Common questions

### Can I keep my other analytics tools on Sherpa?

Yes. Paste the snippet for anything you use and tell your agent to install it. It runs alongside Sherpa's built-in analytics.

### How do I add a tracking pixel or chat widget?

Paste the snippet into your chat. Your agent adds it to the website and builds a preview so you can check the tool is receiving data.

### Will scripts slow my website down?

Your agent loads them after the page is ready, and only on the pages that need them.

### Can I see what is already installed?

Yes. Ask your agent what your website loads and remove what you no longer use.

## Example prompts

Each one works as written in Claude or ChatGPT once Sherpa is connected. Swap in your own pages and dates.

### The request from the example

> Add the tracking snippet below to every page of my website. Load it after the page is ready so it does not slow anything down, and tell me how to confirm it is working.

It says where the script goes, how it should load and asks for a way to check. Most script problems are one of those three.

### The script inventory

> Which third-party scripts does my website load, on which pages, and which of them slow the page down most?

An inventory with a cost beside each one tells you what to cut.

### The clean removal

> Remove the old chat widget from every page and confirm nothing else depended on it.

Scripts get tangled with the pages around them. The check avoids a broken button.

### The targeted pixel

> Only load the LinkedIn pixel on /pricing and /demo.

Fewer pages means less load time everywhere else.

## For agents

Sherpa MCP tools for this job, in the order they are usually called. `search_files`, `edit_files`, `preview_change`. Work inside a change, and only call submit_change when the person asks to publish. A person presses Publish. Every tool is described in the [MCP reference](https://www.withsherpa.ai/docs/mcp-reference).

## Next

[**Read your analytics** See everything Sherpa records about your website, what the dashboard shows and how much more your agent can pull out of it.](https://www.withsherpa.ai/docs/analytics-overview) [**Agent analytics** See every AI agent that reads your website, what it asked for and where it got stuck, so you can show up in more AI answers.](https://www.withsherpa.ai/docs/agent-analytics)
