Commit graph

12 commits

Author SHA1 Message Date
38f5dc444f feat: duplicate campaigns, ad sets and ads like the Meta Ads Manager
Adds a "Duplicar" button on every campaign, ad set and ad row, mirroring
the native Duplicate in Ads Manager. Uses Meta's /copies endpoint with
deep_copy for campaigns/ad sets (children come along) and always creates
the copy as PAUSED with a " - Cópia" suffix so it's safe to review before
activating. This lets users grow a campaign by cloning: duplicate an ad
for a new creative, duplicate an ad set for a new "subcampanha", or
duplicate a whole campaign.

Backend: copy_campaign/copy_adset/copy_ad tools in the Graph wrapper,
duplicateEntity() helper, and a single POST /api/meta/duplicate route.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 14:33:24 -03:00
a88e96adf5 fix: fall back to Facebook-only when ad account can't use the page's Instagram
Meta rejects the whole ad creative with error 200/1815199 when the ad
account isn't authorized (in Business Manager) to use the Instagram
account linked to the chosen page. Picking a different page in the new
selector doesn't help if that page's IG is also unshared. Now, when the
creative fails for that specific reason, we retry without
instagram_actor_id so the ad still publishes on Facebook, and the modal
explains why Instagram was dropped and how to enable it.

createFullCampaign gets the same fallback for free.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 14:21:18 -03:00
dcaf7959ac feat: let users pick the Page/Instagram account when adding ads to a campaign
Some ad accounts aren't authorized to use the Instagram account that's
auto-detected from the existing ad set, causing Meta error 200/1815199
on publish. The new selector lists all of the user's connected Pages
(with linked Instagram accounts) so they can choose a valid combination
themselves, falling back to the auto-detected default. Also paginate
/me/accounts so accounts beyond the first page show up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 14:10:06 -03:00
b4ad2e0585 feat: pre-preenche contexto do modal de novo anuncio com a copy existente
A geracao de copy/imagem por IA exigia que o usuario descrevesse o
anuncio do zero. Agora getAdSetDefaultCreative tambem extrai o texto
do criativo de um anuncio ja existente no ad set (headline, mensagem
e descricao) e o AddAdModal usa isso para preencher automaticamente
o campo de contexto, permitindo gerar variacoes no mesmo tom sem
digitar nada.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 13:18:41 -03:00
d2406f0152 feat: permite adicionar novos anuncios a campanhas ja ativas
Adiciona modal "+ Anuncio" na tabela de campanhas que reaproveita o
fluxo de geracao de copy/imagem por IA para publicar novos criativos
no mesmo ad set existente, mantendo orcamento e segmentacao.

- Extrai pipeline de upload+criativo+anuncio (addAdToAdSet) do
  createFullCampaign para reuso
- Adiciona get_adset_default_creative para pre-preencher pagina,
  link, instagram e CTA com base em anuncio ja existente no ad set
- Novas rotas POST /api/adsets/[id]/ads e
  GET /api/adsets/[id]/creative-defaults
- Novo componente AddAdModal com geracao de copy/imagem via IA ou
  upload manual

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 12:54:00 -03:00
f47c9e58ce fix: resolve OAuth redirects dynamically using client-facing headers 2026-06-07 22:01:52 -03:00
568fb16a89 Atualizar src/app/api/auth/callback/route.ts 2026-06-08 00:49:23 +00:00
348723f39f Atualizar src/app/api/auth/meta/route.ts 2026-06-08 00:48:16 +00:00
61b5303ee5 Atualizar src/app/api/auth/meta/route.ts 2026-06-08 00:41:22 +00:00
d5997bb0d8 Atualizar src/lib/engine/monitor.ts 2026-06-07 23:58:51 +00:00
Marcio Bevervanso
234314d1c6 Publish MetaAds Pro: AI-driven Meta Ads campaign management dashboard
Full app with AI campaign creation/copy/creative generation, dashboard,
campaign automation engine, Meta OAuth login, and a redesigned landing page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 19:30:33 -03:00
Marcio Bevervanso
b955aee644 Initial commit from Create Next App 2026-05-07 17:04:31 -03:00