---
name: coppica-close-the-loop
description: Use whenever a Coppica-generated output gets deployed, or whenever a conversion happens. This is the non-negotiable discipline that makes Coppica learn. Load it every time you deploy copy.
---

# Close the loop

This is the most important skill, and the one most integrations skip. Coppica only gets smarter
if it learns what converted. No outcomes means no learning, means generation stays generic.

## The rule

1. **Every deployed output gets a tracking link.**
2. **Every conversion, and meaningful engagement, gets reported against that output.**

## Steps

1. **Attach tracking.** When you deploy an output, create a tracking link for it:
   `POST /v1/clients/{clientId}/tracking-links`. It returns a UTM-tagged URL. Use that URL in the wild
   (ad, email, page) so downstream conversions can be attributed back to this exact copy.
2. **Report outcomes.** When something happens (a sale, signup, click, reply, or qualitative
   feedback), call `coppica_report_outcome` against the `output_id`. This is the flagship
   feedback primitive; it is what makes the API compound in value over time.
3. **Repeat for every variant.** In an ad set, each variant is tracked and reported separately,
   or you can't tell them apart.

## Decision branches

- **Conversions arrive via a platform webhook (Shopify, CRM, etc.)?** Wire that webhook to call
  `coppica_report_outcome`, so reporting is automatic, not manual.
- **You have historical conversions for old copy?** Load `coppica-backfill` first to create
  output IDs you can report against.

## Verify

`coppica_report_outcome` returns success and references the right `output_id`.

## Next

Once outcomes accumulate, run `coppica-optimization-loop` on a cadence.
