# plugin-marketing

`@fayz-ai/plugin-marketing` · beta · Capability parcial

Marketing analytics are always the same shape — channels, campaigns, a funnel, landing-page CVR — but what counts as a "conversion" changes per business. A salon converts a booking, a store converts an order, an agency converts a lead. plugin-marketing is one plugin that adapts to all of them: pick a domain preset (or pass an explicit conversion model + channels) and the funnel, channel…

## Ficha técnica

- **Pacote:** `@fayz-ai/plugin-marketing`
- **Versão:** 0.2.1
- **Status:** beta
- **Capability:** Capability parcial
- **Tipo de produto:** Gestão (Admin/SaaS)
- **Canal stable:** `^0.2.1`
- **Migrations:** 4 migration(s)
- **Factory:** `createMarketingPlugin()`

## Modelo de dados

Tabelas instaladas (convenção `plg_` · `tenant_id` + RLS):

- `plg_marketing_social_accounts` — name, handle, platform, is_active
- `plg_marketing_content_plans` — account_id, name, status, weeks_count, start_date, objective
- `plg_marketing_content_posts` — plan_id, week_number, position, title, format, status

## Tools de IA

| id | modo | descrição |
| --- | --- | --- |
| `marketing.channel-performance` | read | Returns acquisition performance per channel (reach, conversions, CVR, spend, CPA). |
| `marketing.top-channels` | read | Returns the top acquisition channels ranked by conversions. |
| `marketing.campaign-cvr` | read | Lists campaigns with their conversion rate for a date range. |
| `marketing.create-campaign` | persist | Creates an acquisition campaign on a channel. |

## Integrações

Sem conector hospedado — provedores externos via spine de conectores (`@fayz-ai/core`).

## Integrar

Adicione o plugin em `surfaces.admin.plugins` do `app.manifest.json` e rode o doctor:

```json
{ "surfaces": { "admin": { "plugins": [ { "id": "marketing", "enabled": true } ] } } }
```

```bash
npx fayz doctor
```
