> For the complete documentation index, see [llms.txt](https://support.sayprimer.com/primer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.sayprimer.com/primer/connections/website-tracking/installing-the-pixel.md).

# Installing the pixel

Add Primer's website pixel to your site by pasting the snippet or using Google Tag Manager.

Primer's website pixel identifies the companies and people visiting your site so you can build audiences and track conversions from that traffic.

## The snippet

Add this script to your site, replacing `{CLIENT_ID}` with your organization's client ID (shown in Primer when you set up the website pixel):

```html
<script async src="https://web-script.api.sayprimer.com/primerAnalytics.js?clientId={CLIENT_ID}"></script>
```

## Where to put it

* **Directly in your HTML** — paste the snippet into the `<head>` of every page.
* **Google Tag Manager** — add it as a **Custom HTML** tag that fires on all pages.

## Content Security Policy

If your site sets a Content Security Policy, add these domains to the matching directives — if any is missing, the browser blocks the pixel and **no traffic reaches Primer**:

* `script-src https://cdn.jsdelivr.net https://tags.fullcontact.com` — the pixel loads FingerprintJS (from `cdn.jsdelivr.net`) and FullContact (`tags.fullcontact.com`) to identify visitors.
* `connect-src https://web-script.api.sayprimer.com` — the pixel sends events here.

### If the pixel isn't being blocked by CSP

A too-strict CSP fails **silently to you but loudly in the browser**: the page keeps working, but you'll see **Content Security Policy** violation errors in the browser's developer console, and Primer stays **Not connected** because events never leave the page. If connection status won't turn green after installing:

1. Open your browser's developer console on a page with the pixel and look for CSP violations naming `web-script.api.sayprimer.com`, `cdn.jsdelivr.net` or `tags.fullcontact.com`.
2. Add whichever domain is being blocked to the directive named in the error (`script-src` or `connect-src`), then reload.

After installing, check that Primer is receiving traffic — see [Pixel connection status](/primer/connections/website-tracking/pixel-connection-status.md).


---

# 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://support.sayprimer.com/primer/connections/website-tracking/installing-the-pixel.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.
