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

# Attribution survey

> Set the "How did you hear about us?" question and read answers and revenue per channel with your API key or from an AI agent over MCP.

One question on the thank-you page, with your answers and an optional "Other"
text field. Each answer is saved on the order, so the report shows answers and
revenue per channel next to your tracked links' sales. Product guide:
[Attribution survey](/selling/attribution-survey).

<Note>
  Growth plan and above. Saving with `enabled: true` answers `403` with
  `code: FEATURE_LOCKED` on a plan without the survey. Reading the report,
  editing the words and switching it off stay open.
</Note>

## Endpoints

| Method | Endpoint | Operation ID | MCP tool |
| - | - | - | - |
| `GET` | `/attribution-survey/settings` | `getAttributionSurvey` | `get_attribution_survey` |
| `PUT` | `/attribution-survey/settings` | `updateAttributionSurvey` | `update_attribution_survey` |
| `GET` | `/attribution-survey/report` | `getAttributionReport` | `get_attribution_report` |

## Set the question

```bash theme={"system"}
curl -X PUT https://api.pocketsflow.com/attribution-survey/settings \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "question": "How did you hear about us?",
    "options": [
      { "id": "instagram", "label": "Instagram", "channel": "instagram" },
      { "label": "My podcast" },
      { "label": "A friend" }
    ],
    "allowOther": true
  }'
```

* 2 to 12 options, labels up to 60 characters, question up to 120.
* Send an option's `id` to keep its past answers after a rename; new options
  get an id from their label. `other` is reserved for the free-text answer.
* `channel` (optional) is a tracked-link channel: `instagram`, `tiktok`,
  `youtube`, `x`, `facebook`, `email`, `ads` or `other`.

## Read the report

`GET /attribution-survey/report?startDate=…&endDate=…` (ISO dates, 30 days by
default, 366 at most) returns:

| Field | Meaning |
| - | - |
| `totals.shown` | Paid orders whose buyer saw the question |
| `totals.answered` | How many answered |
| `totals.responseRate` | Percent who answered |
| `totals.revenue` | What answered orders paid, account currency |
| `options[]` | `id`, `label`, `channel`, `answers`, `share` (% of answers), `revenue` |
| `other` | `answers`, `share`, `revenue` and the 10 most common `topAnswers` |
| `trackedLinks.channels[]` | Your tracked links' `clicks`, `visitors`, `sales` and `revenue` per channel over the same dates (`locked: true` when your plan has no tracked-link stats) |

Refunded and test orders are left out (the key's mode decides which).


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