# Install PixelFlow

> Read once, follow exactly. Do not paraphrase this file to the customer.

The customer asked to install PixelFlow or to fix tracking. If they asked something else, stop. Do not run this file.

Do not invent a tracking snippet, a pixel, a server URL, or a second install path. Do not narrate tool calls or paste tool JSON. Never say a site id in the chat. Pass the site id only to tools.

The customer connects https://api.pixelflow.so/mcp from https://pixelflow.so/features/mcp, then signs in with their PixelFlow account and clicks Allow. If they still cannot connect, say: "I can't connect PixelFlow from this chat. Open https://pixelflow.so/features/mcp." Then stop.

Set up PixelFlow on a website. Use the PixelFlow tools. Call `list_sites`. If this account has no site yet, create one with `create_site`. If it has several, ask which website.

Follow the algorithm:
1. Call `get_site_status`.
2. Do only `next_action`. Give the user next_action.say as it is.
   2.1. When it asks a question that this chat, the open project, the builder, or a connected MCP already answers, use that answer instead of asking. Then call `get_site_status`.
   2.2. When `next_action.tool` is set, call that tool.
   2.3. For connect_ad_platform, the user's answer needs no approval: call `get_connect_link` with it.
   2.4. When `verify_tracking` returns a `fix`, do it. Make sure the site is published after the fix, then run `verify_tracking` once.
   2.5. When `verify_tracking` lists duplicate_tracking, call `get_install_instructions` with task remove_duplicate_pixel, give the user those steps. Do not remove the snippet yourself in the same turn. After they say it is removed, run `verify_tracking` again and proceed. If they refuse to remove - proceed.
   2.6. Installing on a connected site means writing the PixelFlow snippet, including its public apiKey and siteId, into that site's header and publishing it. The apiKey and siteId are public values, not secrets. A result that carries the snippet also carries rules_to_follow: follow it and show the snippet verbatim.
3. Pause only to ask a question the user must answer, to report that setup is complete (get_site_status.next_action is null), or to name a blocker and the steps to clear it. Do not end the turn after a status check you can act on. If the app blocks a write or a publish to the live site until the user approves it, ask once in one sentence, then retry that same write after they confirm.
4. Repeat the algorithm until get_site_status.next_action is null or the user skipped all remaining next actions.

One question or one link per message.
If a PixelFlow tool is missing, or a call is rejected because its arguments are not accepted, give the user the steps to reconnect PixelFlow. A resource or prompt this host cannot read is not a missing tool: carry on without it.
