> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thrad.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up with an AI agent

> Paste one prompt into your coding agent and it sets up Thrad tracking for you.

Your coding agent (Claude Code, Cursor, Codex and others) can install the Thrad tag, wire your conversions and add server events for you. Copy the prompt, paste it in, and review what it changes.

The quickest way to get the prompt is from the [Thrad platform](https://platform.thrad.ai): open your ad account's **Attribution** page and press **Copy prompt**. Your tag ID is already filled in, along with a setup code that lets the agent check your live site with Thrad. Or copy this one and swap in your tag ID:

```text Prompt: set up Thrad tracking wrap theme={null}
Set up Thrad conversion tracking in this project. My Thrad tag ID is adv_example_123. Fetch https://docs.thrads.ai/skills/thrad-tag/SKILL.md and https://docs.thrads.ai/skills/thrad-conversions-api/SKILL.md. Follow the tag skill in full first: it says how to install the tag on every page, report the actions that matter, and fire the purchase conversion. It ends by asking me about server events. If I say yes, follow the server events skill in this same session. Show me each change before you apply it, and when you're done, tell me what to deploy.
```

1. Open your website's project in your coding agent.
2. Paste the prompt.
3. Review the changes it shows you, then deploy them.
4. Tell the agent once it's live. If your prompt came from the platform, the agent asks Thrad to check your site and tells you whether it passed. Otherwise, run the site check on the **Attribution** page (or under **Setup → Confirm your tracking** if your page still has tabs).
5. The agent recommends server events and asks whether to add them. If you say yes, it adds them, then asks you to create a server token in Thrad.

> [accordion] Why the agent recommends server events
>
> The tag reports purchases from your shopper's browser. Ad blockers, browser tracking limits and shoppers who close the tab early stop some of those reports, so those sales aren't credited to your ads. With server events, your server reports each order too. Thrad matches the two by order ID, so nothing is counted twice.
>
> The agent can't create the server token for you, and it never asks for it. When it's done, open the **Attribution** page, choose **Create server token** (or **Create token** under **Setup → Send conversions from your server** if your page still has tabs), and save the token as `THRAD_SERVER_TOKEN` wherever your server keeps secrets. The agent's code reads it from there. Never paste the token into the chat.
>
> Said "not now"? Ask your agent to add server events any time, or see [Server events](https://docs.thrad.ai/advertisers/attribution/server-events/overview.md).

> [accordion] What the setup code can do
>
> The setup code starts with `tsc_` and expires after 24 hours. It only lets the agent run Thrad's site check on your ad account's own websites and read the result. It stops working if you lose edit access to the account. It can't change your account, read your reports, or send events. If it expires, copy a fresh prompt.

> [accordion] What the agent follows
>
> The prompt points your agent at a **skill**: a Markdown file with everything it needs to integrate Thrad correctly. It's fetched fresh each time, so it never goes stale.
>
> | Skill | What it sets up |
> | - | - |
> | [`thrad-tag`](https://docs.thrads.ai/skills/thrad-tag/SKILL.md) | The tag on every page, your key events and the purchase conversion. Handles Shopify, Google Tag Manager and site builders. |
> | [`thrad-conversions-api`](https://docs.thrads.ai/skills/thrad-conversions-api/SKILL.md) | Server events, deduplicated with the tag. The tag skill hands off to it when you say yes. |
>
> The agent only edits your code. It never deploys. For Google Tag Manager, Shopify admin and site builders, it writes the snippets and tells you where to paste them.

Prefer to do it by hand? [Install the tag](https://docs.thrad.ai/advertisers/attribution/tag/install.md) yourself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.