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

# Best Practices

> Recommendations for getting the most out of AgentRef.

## For Merchants

### Program Setup

* **Set competitive commission rates** – research what similar products offer. 20-30% recurring is standard for SaaS.
* **Use reasonable cookie durations** – 60-90 days is typical. Too short means lost attributions; too long rarely adds value.
* **Write clear program descriptions** – affiliates (and their AI agents) need to understand your product and terms quickly.

### Tracking

* **Install tracking on all pages** – not just the landing page. Visitors may enter from blog posts, docs, or pricing pages.
* **Test before launch** – use debug mode (`?agentref_debug=1`) to verify cookies are set and clicks are recorded.
* **Use Stripe Checkout integration** – it's the most reliable way to attribute conversions. AgentRef does not require a separate conversion-reporting call when Stripe metadata is present.

### Fraud Prevention

* **Review flags promptly** – unresolved flags can lead to disputed payouts.
* **Start with manual approval for new affiliates** – auto-approve only after they've built a track record.
* **Monitor click-to-conversion ratios** – very high or very low ratios can indicate problems.

### Affiliate Relations

* **Respond to applications quickly** – affiliates will move on to competing programs if they wait too long.
* **Provide marketing materials** – make it easy for affiliates to promote your product correctly.
* **Pay on time** – nothing kills an affiliate relationship faster than delayed or missed payouts.

## For Affiliates

### Getting Started

* **Choose programs you genuinely use** – authentic recommendations convert better than generic promotions.
* **Use sub-IDs to track placements** – know which blog posts, videos, or channels drive the most conversions.
* **Disclose affiliate relationships** – it's legally required in most jurisdictions and builds trust with your audience.

### Optimization

* **Link from contextually relevant content** – a referral in a product review converts better than a sidebar banner.
* **Use deep links when possible** – link directly to pricing or signup pages, not just the homepage.
* **Track your metrics** – use the dashboard or API to monitor clicks, conversions, and earnings regularly.

## For AI Agents

### Integration

* **Use the MCP Server** – it provides the richest interface for agent interaction across merchant setup, growth, payouts, and affiliate workflows.
* **Read `llms.txt` first** – it gives you a concise overview of all available endpoints and capabilities.
* **Use idempotency keys** – when creating programs, invites, payouts, links, or resources, include idempotency keys to prevent duplicates.

### Automation

* **Check affiliate status before promoting** – verify your affiliate account is approved and active before generating referral links.
* **Monitor earnings programmatically** – use the stats endpoints to track performance and adjust strategies.
* **Handle errors gracefully** – the API uses standard HTTP codes. Implement retry logic for transient failures (429, 500, 503).

<Info>
  The [Agent Setup Guide](/getting-started/agent-setup) has detailed examples for configuring AI agents with AgentRef.
</Info>
