cdp-edge 2.5.6 → 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -8
- package/contracts/agent-versions.json +2 -2
- package/contracts/api-versions.json +8 -8
- package/extracted-skill/tracking-events-generator/INSTALACAO-CDPEDGE.md +2 -2
- package/extracted-skill/tracking-events-generator/INTEGRACAO-COMPLETA.md +3 -3
- package/extracted-skill/tracking-events-generator/Premium-Tracking-Intelligence-Resumo.md +1 -1
- package/extracted-skill/tracking-events-generator/SKILL.md +4 -4
- package/extracted-skill/tracking-events-generator/advanced-matching.js +1 -1
- package/extracted-skill/tracking-events-generator/agents/attribution-agent.md +3 -3
- package/extracted-skill/tracking-events-generator/agents/browser-tracking.md +2 -2
- package/extracted-skill/tracking-events-generator/agents/code-guardian-agent.md +2 -2
- package/extracted-skill/tracking-events-generator/agents/debug-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/intelligence-agent.md +6 -6
- package/extracted-skill/tracking-events-generator/agents/master-orchestrator.md +31 -21
- package/extracted-skill/tracking-events-generator/agents/match-quality-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/memory-agent.md +8 -8
- package/extracted-skill/tracking-events-generator/agents/meta-agent.md +8 -8
- package/extracted-skill/tracking-events-generator/agents/page-analyzer.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/premium-tracking-intelligence-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/security-enterprise-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/server-tracking.md +9 -9
- package/extracted-skill/tracking-events-generator/agents/spotify-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/tracking-plan-agent.md +5 -5
- package/extracted-skill/tracking-events-generator/agents/validator-agent.md +8 -8
- package/extracted-skill/tracking-events-generator/agents/webhook-agent.md +4 -4
- package/extracted-skill/tracking-events-generator/agents/whatsapp-agent.md +7 -7
- package/extracted-skill/tracking-events-generator/agents/whatsapp-ctwa-setup-agent.md +16 -16
- package/extracted-skill/tracking-events-generator/agents/zapman-agent.md +189 -0
- package/extracted-skill/tracking-events-generator/cdpTrack.js +1 -1
- package/extracted-skill/tracking-events-generator/contracts/api-versions.json +8 -8
- package/extracted-skill/tracking-events-generator/docs/guia-cloudflare-iniciante.md +2 -2
- package/extracted-skill/tracking-events-generator/evals/evals.json +5 -5
- package/extracted-skill/tracking-events-generator/knowledge-base.md +5 -5
- package/extracted-skill/tracking-events-generator/models/captura-de-lead.md +1 -1
- package/extracted-skill/tracking-events-generator/models/checkout-proprio.md +1 -1
- package/extracted-skill/tracking-events-generator/models/lancamento-imobiliario.md +1 -1
- package/extracted-skill/tracking-events-generator/models/multi-step-checkout.md +5 -5
- package/extracted-skill/tracking-events-generator/models/pagina-obrigado.md +1 -1
- package/extracted-skill/tracking-events-generator/models/trafego-direto.md +4 -4
- package/extracted-skill/tracking-events-generator/models/webinar-registration.md +1 -1
- package/package.json +1 -1
- package/server-edge-tracker/INSTALAR.md +3 -3
- package/server-edge-tracker/index.ts +37 -36
- package/server-edge-tracker/modules/db.ts +1 -1
- package/server-edge-tracker/modules/dispatch/crm.ts +26 -363
- package/server-edge-tracker/modules/dispatch/meta.ts +2 -2
- package/server-edge-tracker/modules/dispatch/whatsapp.ts +7 -18
- package/server-edge-tracker/modules/intelligence.ts +4 -4
- package/server-edge-tracker/modules/nurture.ts +1 -1
- package/server-edge-tracker/schema.sql +1 -1
- package/server-edge-tracker/types.ts +6 -8
- package/server-edge-tracker/wrangler.toml +143 -140
- package/templates/captura-de-lead.md +1 -1
- package/templates/checkout-proprio.md +1 -1
- package/templates/lancamento-imobiliario.md +1 -1
- package/templates/multi-step-checkout.md +5 -5
- package/templates/pagina-obrigado.md +1 -1
- package/templates/trafego-direto.md +4 -4
- package/templates/webinar-registration.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/evo-crm-agent.md +0 -253
|
@@ -39,7 +39,7 @@ Cloudflare Edge (Worker)
|
|
|
39
39
|
├── KV Namespace ← Cache de geo/ip e sessão
|
|
40
40
|
└── Cron Triggers ← Limpeza de dados + Reporte Financeiro
|
|
41
41
|
│
|
|
42
|
-
├──▶ Meta CAPI
|
|
42
|
+
├──▶ Meta CAPI v25.0 (sendMetaCapi)
|
|
43
43
|
├──▶ Google GA4 MP (sendGA4Mp)
|
|
44
44
|
├──▶ TikTok Events API v1.3 (sendTikTokApi)
|
|
45
45
|
├──▶ Pinterest CAPI v5 (sendPinterestCapi — template, ativar via secret)
|
|
@@ -549,7 +549,7 @@ async function syncIdentity(DB, body) {
|
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
// META CAPI
|
|
552
|
+
// META CAPI v25.0 (com Engagement Scoring + Advanced Matching Maximum)
|
|
553
553
|
async function dispatchMetaCapi(body, env, visitor, engagementScore, clientIP, userAgent, cf) {
|
|
554
554
|
if (!env.META_ACCESS_TOKEN || !body.pixel_id) return;
|
|
555
555
|
|
|
@@ -608,7 +608,7 @@ async function dispatchMetaCapi(body, env, visitor, engagementScore, clientIP, u
|
|
|
608
608
|
}]
|
|
609
609
|
};
|
|
610
610
|
|
|
611
|
-
await fetch(`https://graph.facebook.com/
|
|
611
|
+
await fetch(`https://graph.facebook.com/v25.0/${body.pixel_id}/events?access_token=${env.META_ACCESS_TOKEN}`, {
|
|
612
612
|
method: 'POST',
|
|
613
613
|
headers: { 'Content-Type': 'application/json' },
|
|
614
614
|
body: JSON.stringify(payload)
|
|
@@ -756,7 +756,7 @@ const finalScore = (
|
|
|
756
756
|
|
|
757
757
|
### Integração com Plataformas
|
|
758
758
|
|
|
759
|
-
**Meta CAPI
|
|
759
|
+
**Meta CAPI v25.0:**
|
|
760
760
|
```typescript
|
|
761
761
|
custom_data: {
|
|
762
762
|
engagement_score: engagementScore.server_engagement_score,
|
|
@@ -800,7 +800,7 @@ context: {
|
|
|
800
800
|
2. **Same-Domain**: Worker no domínio do site (anti-adblock).
|
|
801
801
|
3. **Umbrella Protocol**: Cookies com abrangência de domínio.
|
|
802
802
|
4. **SHA-256 Nativo**: WebCrypto API sempre.
|
|
803
|
-
5. **Meta CAPI**: Sempre versão `
|
|
803
|
+
5. **Meta CAPI**: Sempre versão `v25.0`.
|
|
804
804
|
6. **TikTok Events API**: Sempre versão `v1.3`.
|
|
805
805
|
7. **Background Execution**: `ctx.waitUntil()` para não bloquear o usuário.
|
|
806
806
|
8. **Anti-Blocking Server-Side**: Worker deve aceitar requests de qualquer user-agent, evitar headers que ativam ad-blockers, responder rapidamente.
|
|
@@ -855,7 +855,7 @@ const corsHeaders = {
|
|
|
855
855
|
2. **Same-Domain**: Worker no domínio do site.
|
|
856
856
|
3. **Umbrella Protocol**: Cookies com abrangência de domínio.
|
|
857
857
|
4. **SHA-256 Nativo**: WebCrypto API sempre.
|
|
858
|
-
5. **Meta CAPI**: Sempre versão `
|
|
858
|
+
5. **Meta CAPI**: Sempre versão `v25.0`.
|
|
859
859
|
6. **TikTok Events API**: Sempre versão `v1.3`.
|
|
860
860
|
7. **Background Execution**: `ctx.waitUntil()` para não bloquear o usuário.
|
|
861
861
|
|
|
@@ -895,10 +895,10 @@ async function dispatchMetaCapi(body, env, visitor, heatScore, clientIP, userAge
|
|
|
895
895
|
const em = await sha256(body.email);
|
|
896
896
|
const ph = await sha256((body.phone || '').replace(/\D/g, ''));
|
|
897
897
|
|
|
898
|
-
const payload = { /* payload Meta CAPI
|
|
898
|
+
const payload = { /* payload Meta CAPI v25.0 */ };
|
|
899
899
|
|
|
900
900
|
const response = await fetch(
|
|
901
|
-
`https://graph.facebook.com/
|
|
901
|
+
`https://graph.facebook.com/v25.0/${body.pixel_id}/events?access_token=${env.META_ACCESS_TOKEN}`,
|
|
902
902
|
{
|
|
903
903
|
method: 'POST',
|
|
904
904
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -1053,7 +1053,7 @@ Timestamp: ${new Date().toISOString()}
|
|
|
1053
1053
|
const adminNumber = env.ADMIN_PHONE_NUMBER;
|
|
1054
1054
|
|
|
1055
1055
|
if (waPhoneId && adminNumber) {
|
|
1056
|
-
await fetch(`https://graph.facebook.com/
|
|
1056
|
+
await fetch(`https://graph.facebook.com/v25.0/${waPhoneId}/messages`, {
|
|
1057
1057
|
method: 'POST',
|
|
1058
1058
|
headers: {
|
|
1059
1059
|
'Content-Type': 'application/json',
|
|
@@ -372,7 +372,7 @@ Ao final, gere um relatório JSON:
|
|
|
372
372
|
|
|
373
373
|
| Plataforma | Documentação | API v1 | Recursos |
|
|
374
374
|
|-----------|---------------|--------|----------|
|
|
375
|
-
| Meta | Excelente |
|
|
375
|
+
| Meta | Excelente | v25.0+ | Muito completo |
|
|
376
376
|
| Google | Excelente | MP | Muito completo |
|
|
377
377
|
| TikTok | Boa | v1.3+ | Completo |
|
|
378
378
|
| **Spotify** | Limitada | v1 | Básico |
|
|
@@ -305,7 +305,7 @@ async function runFullValidation(pageAnalysis, agentOutputs, apiVersions) {
|
|
|
305
305
|
|--------|--------|------|------|------|-----------|-----------|-----------|
|
|
306
306
|
| Lead | Submit #form-hero | /index.html | `fbq('track','Lead')` | `generate_lead` | `SubmitForm` | — | 🔴 Crítico | ✅ Implementado |
|
|
307
307
|
| InitiateCheckout | Click `a[href*='hotmart']` | /index.html | `InitiateCheckout` | — | `InitiateCheckout` | — | 🔴 Crítico | ⚠️ Verificar |
|
|
308
|
-
| Purchase | Webhook Hotmart | server-side | CAPI
|
|
308
|
+
| Purchase | Webhook Hotmart | server-side | CAPI v25.0 | MP | Events API | Conversion | 🔴 Crítico | ✅ Implementado |
|
|
309
309
|
| ScrollDepth 50% | Scroll ≥ 50% | todas | CustomEvent | `scroll_depth` | — | — | 🟢 Recomendado | ✅ Implementado |
|
|
310
310
|
|
|
311
311
|
---
|
|
@@ -314,13 +314,13 @@ async function runFullValidation(pageAnalysis, agentOutputs, apiVersions) {
|
|
|
314
314
|
|
|
315
315
|
### Lead
|
|
316
316
|
|
|
317
|
-
- **Meta CAPI
|
|
317
|
+
- **Meta CAPI v25.0:**
|
|
318
318
|
- content_name: "Lead Formulário Principal"
|
|
319
319
|
- value: 0
|
|
320
320
|
- currency: "BRL"
|
|
321
321
|
- user_data: email (SHA256), phone (SHA256), fn, ln, ct, st, zp
|
|
322
322
|
- deduplicação: event_id = cdp_{timestamp}_{random}
|
|
323
|
-
- server-side: Meta CAPI
|
|
323
|
+
- server-side: Meta CAPI v25.0
|
|
324
324
|
- ✅ Parâmetros completos
|
|
325
325
|
|
|
326
326
|
- **GA4 MP:**
|
|
@@ -339,7 +339,7 @@ async function runFullValidation(pageAnalysis, agentOutputs, apiVersions) {
|
|
|
339
339
|
|
|
340
340
|
### Purchase
|
|
341
341
|
|
|
342
|
-
- **Meta CAPI
|
|
342
|
+
- **Meta CAPI v25.0:**
|
|
343
343
|
- content_name: "Produto Hotmart"
|
|
344
344
|
- value: {normalizado}
|
|
345
345
|
- currency: "BRL"
|
|
@@ -347,7 +347,7 @@ async function runFullValidation(pageAnalysis, agentOutputs, apiVersions) {
|
|
|
347
347
|
- transaction_id: {id_transacao_hotmart}
|
|
348
348
|
- user_data: email (SHA256), phone (SHA256), fbp, fbc, geo
|
|
349
349
|
- deduplicação: event_id = cdp_{timestamp}_{random}
|
|
350
|
-
- server-side: Meta CAPI
|
|
350
|
+
- server-side: Meta CAPI v25.0
|
|
351
351
|
- ✅ Parâmetros completos
|
|
352
352
|
|
|
353
353
|
- **GA4 MP:**
|
|
@@ -12,7 +12,7 @@ Você é o agente de controle de qualidade do CDP Edge. Sua responsabilidade: **
|
|
|
12
12
|
|
|
13
13
|
### PASSO 1 — Verificações de API
|
|
14
14
|
|
|
15
|
-
- **Meta CAPI**: Endpoint DEVE ser `https://graph.facebook.com/
|
|
15
|
+
- **Meta CAPI**: Endpoint DEVE ser `https://graph.facebook.com/v25.0/{PIXEL_ID}/events`. Rejeitar versões < v25.0.
|
|
16
16
|
- **TikTok Events API**: Endpoint DEVE ser `https://business-api.tiktok.com/open_api/v1.3/event/track/`. Rejeitar versões < v1.3.
|
|
17
17
|
- **GA4 MP**: Endpoint `https://www.google-analytics.com/mp/collect`. `client_id` e `transaction_id` (em compras) são obrigatórios.
|
|
18
18
|
- **Hashing**: DEVE utilizar `crypto.subtle.digest('SHA-256', ...)` no Worker.
|
|
@@ -70,12 +70,12 @@ Quando detectar erro, emitir bloco `CORRECTION_ROUTE` com formato:
|
|
|
70
70
|
"priority": "CRITICAL",
|
|
71
71
|
"issue_detected": "API version desatualizada",
|
|
72
72
|
"current_state": "Meta CAPI v21.0 detectado",
|
|
73
|
-
"required_state": "Meta CAPI
|
|
74
|
-
"urgent_instruction": "ATUALIZAR IMEDIATAMENTE: substituir todas as ocorrências de '/v21.0/' por '/
|
|
73
|
+
"required_state": "Meta CAPI v25.0+ obrigatório",
|
|
74
|
+
"urgent_instruction": "ATUALIZAR IMEDIATAMENTE: substituir todas as ocorrências de '/v21.0/' por '/v25.0/' no código gerado",
|
|
75
75
|
"validation_criteria": {
|
|
76
76
|
"check_pattern": "/v21.0/",
|
|
77
|
-
"expected_pattern": "/
|
|
78
|
-
"test_url": "https://graph.facebook.com/
|
|
77
|
+
"expected_pattern": "/v25.0/",
|
|
78
|
+
"test_url": "https://graph.facebook.com/v25.0/{PIXEL_ID}/events",
|
|
79
79
|
"response_expected": "200 OK com payload válido"
|
|
80
80
|
},
|
|
81
81
|
"files_affected": ["index.ts", "modules/dispatch/meta.ts"],
|
|
@@ -180,12 +180,12 @@ Meta CAPI está usando versão v21.0 (desatualizada) — isso causará rejeiçã
|
|
|
180
180
|
|
|
181
181
|
1. **Abrir o arquivo:** `modules/dispatch/meta.ts`
|
|
182
182
|
2. **Localizar:** Todas as ocorrências de `/v21.0/`
|
|
183
|
-
3. **Substituir por:** `/
|
|
184
|
-
4. **Testar:** Fazer uma requisição de teste para https://graph.facebook.com/
|
|
183
|
+
3. **Substituir por:** `/v25.0/`
|
|
184
|
+
4. **Testar:** Fazer uma requisição de teste para https://graph.facebook.com/v25.0/{SEU_PIXEL_ID}/events
|
|
185
185
|
|
|
186
186
|
### Critérios de Validação:
|
|
187
187
|
|
|
188
|
-
- [ ] Endpoint atualizado para
|
|
188
|
+
- [ ] Endpoint atualizado para v25.0
|
|
189
189
|
- [ ] Payload contém todos os campos obrigatórios
|
|
190
190
|
- [ ] Teste de API retorna 200 OK
|
|
191
191
|
- [ ] Event aparece no Events Manager da Meta
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agente: Webhook (Offline Conversions) — CDP Edge
|
|
2
2
|
|
|
3
|
-
Você é o especialista em Webhooks do CDP Edge. Sua missão é capturar vendas offline (Hotmart, Kiwify, Ticto, Stripe) e enviar para as APIs (Meta CAPI
|
|
3
|
+
Você é o especialista em Webhooks do CDP Edge. Sua missão é capturar vendas offline (Hotmart, Kiwify, Ticto, Stripe) e enviar para as APIs (Meta CAPI v25.0, TikTok v1.3).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -58,7 +58,7 @@ async function hashWebhookUserData(webhookPayload) {
|
|
|
58
58
|
|
|
59
59
|
1. **D1 Identity Cross-Check**: Utilize o e-mail ou telefone do webhook para buscar no banco **D1** os identificadores originais (`fbp`, `fbc`, `ttp`). Isso garante a precisão da atribuição.
|
|
60
60
|
2. **Persistência D1**: Toda a informação financeira e de lead deve ser salva nas tabelas do banco D1.
|
|
61
|
-
3. **Meta CAPI
|
|
61
|
+
3. **Meta CAPI v25.0**: Dispare o evento `Purchase` utilizando a versão mais recente da API.
|
|
62
62
|
4. **Processamento Assíncrono**: O Worker deve responder com sucesso à plataforma de vendas e processar o envio em background via `ctx.waitUntil`.
|
|
63
63
|
|
|
64
64
|
---
|
|
@@ -84,7 +84,7 @@ Webhook (Hotmart/Kiwify/Ticto/Stripe)
|
|
|
84
84
|
├─► [4] Hashear PII (SHA-256) — ver seção acima
|
|
85
85
|
│
|
|
86
86
|
├─► [5] CAPI Dispatch (ctx.waitUntil) — paralelo:
|
|
87
|
-
│ → Meta CAPI
|
|
87
|
+
│ → Meta CAPI v25.0 (Purchase)
|
|
88
88
|
│ → GA4 MP (purchase)
|
|
89
89
|
│ → TikTok Events API v1.3 (CompletePayment)
|
|
90
90
|
│
|
|
@@ -144,7 +144,7 @@ ctx.waitUntil(Promise.allSettled([
|
|
|
144
144
|
- Fazer D1 cross-check por email → fallback por `user_id` para recuperar `fbp`, `fbc`, `ttp`
|
|
145
145
|
- Deduplificar por `transaction_id` no D1 — ignorar webhooks duplicados
|
|
146
146
|
- Normalizar valor em centavos → BRL (dividir por 100 quando necessário)
|
|
147
|
-
- Disparar `Purchase` via Meta CAPI
|
|
147
|
+
- Disparar `Purchase` via Meta CAPI v25.0, GA4 MP e TikTok Events API v1.3 em paralelo (`Promise.allSettled`)
|
|
148
148
|
- Registrar transação no D1 `webhook_events` com status `processed`
|
|
149
149
|
- Responder 200 imediatamente à plataforma — processar dispatch em `ctx.waitUntil`
|
|
150
150
|
|
|
@@ -6,10 +6,10 @@ Você é o **Especialista em Mensageria WhatsApp (Quantum Tier)** do CDP Edge. S
|
|
|
6
6
|
|
|
7
7
|
## 📲 PROTOCOLOS DE ATUAÇÃO (Quantum Tier)
|
|
8
8
|
|
|
9
|
-
1. **Meta Cloud API
|
|
9
|
+
1. **Meta Cloud API v25.0 (Eixo Vendas/Notificações ao dono)**:
|
|
10
10
|
- **Público**: O dono do sistema — notificações de Nova Venda e Novo Lead em tempo real.
|
|
11
11
|
- **Objetivo**: Avisar o dono quando chegar uma venda ou lead via webhook.
|
|
12
|
-
- **Padrão**: API oficial Meta
|
|
12
|
+
- **Padrão**: API oficial Meta v25.0 — `POST /v25.0/{WHATSAPP_PHONE_NUMBER_ID}/messages`.
|
|
13
13
|
- **Secrets**: `WHATSAPP_PHONE_NUMBER_ID`, `WHATSAPP_ACCESS_TOKEN`, `WA_NOTIFY_NUMBER`.
|
|
14
14
|
2. **CallMeBot (Eixo Guardião/Alertas de Sistema)**:
|
|
15
15
|
- **Público**: O dono do sistema (admin).
|
|
@@ -61,7 +61,7 @@ Worker envia evento 'Contact' à Meta CAPI:
|
|
|
61
61
|
↓
|
|
62
62
|
Worker salva no D1: tabela whatsapp_contacts
|
|
63
63
|
↓
|
|
64
|
-
WhatsApp Agent dispara notificação ao dono via Meta Cloud API
|
|
64
|
+
WhatsApp Agent dispara notificação ao dono via Meta Cloud API v25.0
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
### O que este agente gera para o fluxo CTWA
|
|
@@ -92,7 +92,7 @@ async function notifyOwnerNewCtwaLead(env, contactData) {
|
|
|
92
92
|
|
|
93
93
|
## RESPONSABILIDADE
|
|
94
94
|
|
|
95
|
-
- Gerar função `sendWhatsApp(env, tipo, payload)` — Meta Cloud API
|
|
95
|
+
- Gerar função `sendWhatsApp(env, tipo, payload)` — Meta Cloud API v25.0 para Purchase e Lead
|
|
96
96
|
- Gerar função `sendCallMeBot(env, mensagem)` — alertas de sistema via GET simples
|
|
97
97
|
- Garantir que `sendIntelligenceAlert()` chama `sendCallMeBot` (nunca `sendWhatsApp`)
|
|
98
98
|
- Executar envio assíncrono via `ctx.waitUntil` — nunca bloquear a resposta principal
|
|
@@ -104,14 +104,14 @@ async function notifyOwnerNewCtwaLead(env, contactData) {
|
|
|
104
104
|
```json
|
|
105
105
|
{
|
|
106
106
|
"funcoes_geradas": {
|
|
107
|
-
"sendWhatsApp": "Meta Cloud API
|
|
107
|
+
"sendWhatsApp": "Meta Cloud API v25.0 — Purchase e Lead ao dono",
|
|
108
108
|
"sendCallMeBot": "CallMeBot GET — alertas de sistema ao admin",
|
|
109
109
|
"sendIntelligenceAlert": "chama sendCallMeBot internamente"
|
|
110
110
|
},
|
|
111
111
|
"eixos": {
|
|
112
112
|
"notificacoes": {
|
|
113
|
-
"api": "Meta Cloud API
|
|
114
|
-
"endpoint": "POST /
|
|
113
|
+
"api": "Meta Cloud API v25.0",
|
|
114
|
+
"endpoint": "POST /v25.0/{WHATSAPP_PHONE_NUMBER_ID}/messages",
|
|
115
115
|
"tipos": ["Purchase", "Lead"],
|
|
116
116
|
"secrets": ["WHATSAPP_PHONE_NUMBER_ID", "WHATSAPP_ACCESS_TOKEN", "WA_NOTIFY_NUMBER"]
|
|
117
117
|
},
|
|
@@ -215,7 +215,7 @@ Este é o passo que mais gera confusão. Siga este raciocínio:
|
|
|
215
215
|
Após descobrir a WABA (Fase 5 abaixo), verificar qual app está subscrito:
|
|
216
216
|
|
|
217
217
|
```bash
|
|
218
|
-
curl "https://graph.facebook.com/
|
|
218
|
+
curl "https://graph.facebook.com/v25.0/{WABA_ID}/subscribed_apps?access_token={META_ACCESS_TOKEN}"
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
A resposta vai mostrar o `id` do app conectado:
|
|
@@ -264,7 +264,7 @@ Se o produto "WhatsApp" não aparecer no menu esquerdo → o app ainda não tem
|
|
|
264
264
|
```bash
|
|
265
265
|
# Verificar tipo e permissões
|
|
266
266
|
curl "https://graph.facebook.com/debug_token?input_token={META_ACCESS_TOKEN}&access_token={META_ACCESS_TOKEN}"
|
|
267
|
-
curl "https://graph.facebook.com/
|
|
267
|
+
curl "https://graph.facebook.com/v25.0/me/permissions?access_token={META_ACCESS_TOKEN}"
|
|
268
268
|
```
|
|
269
269
|
|
|
270
270
|
**Tipos de token e comportamentos:**
|
|
@@ -287,13 +287,13 @@ Se `whatsapp_business_management` ausente → NÃO avançar. Solicitar novo toke
|
|
|
287
287
|
|
|
288
288
|
**Método principal** (via contas de anúncios — mais confiável para System Users):
|
|
289
289
|
```bash
|
|
290
|
-
curl "https://graph.facebook.com/
|
|
290
|
+
curl "https://graph.facebook.com/v25.0/me/adaccounts?fields=id,name,business&access_token={META_ACCESS_TOKEN}"
|
|
291
291
|
```
|
|
292
292
|
Extrair `data[0].business.id` → esse é o `{BIZ_ID}`.
|
|
293
293
|
|
|
294
294
|
**Método alternativo** (via endpoint /businesses — nem sempre retorna para System Users):
|
|
295
295
|
```bash
|
|
296
|
-
curl "https://graph.facebook.com/
|
|
296
|
+
curl "https://graph.facebook.com/v25.0/me/businesses?fields=id,name&access_token={META_ACCESS_TOKEN}"
|
|
297
297
|
```
|
|
298
298
|
|
|
299
299
|
**Por que o método via adaccounts é mais confiável:**
|
|
@@ -305,7 +305,7 @@ System Users do tipo "Conversions API" são vinculados ao Business Manager via c
|
|
|
305
305
|
|
|
306
306
|
Antes de buscar via BIZ_ID, tentar diretamente no usuário:
|
|
307
307
|
```bash
|
|
308
|
-
curl "https://graph.facebook.com/
|
|
308
|
+
curl "https://graph.facebook.com/v25.0/me/whatsapp_business_accounts?access_token={META_ACCESS_TOKEN}"
|
|
309
309
|
```
|
|
310
310
|
|
|
311
311
|
Se retornar erro `"Tried accessing nonexisting field"` → campo não existe para esse tipo de token. Prosseguir para Fase 4.
|
|
@@ -316,10 +316,10 @@ Se retornar erro `"Tried accessing nonexisting field"` → campo não existe par
|
|
|
316
316
|
|
|
317
317
|
```bash
|
|
318
318
|
# Tentar owned (WABA própria do Business Manager)
|
|
319
|
-
curl "https://graph.facebook.com/
|
|
319
|
+
curl "https://graph.facebook.com/v25.0/{BIZ_ID}/owned_whatsapp_business_accounts?fields=id,name,status,timezone_id&access_token={META_ACCESS_TOKEN}"
|
|
320
320
|
|
|
321
321
|
# Se data[] vazio, tentar client (WABA de cliente gerenciado pelo BM)
|
|
322
|
-
curl "https://graph.facebook.com/
|
|
322
|
+
curl "https://graph.facebook.com/v25.0/{BIZ_ID}/client_whatsapp_business_accounts?fields=id,name,status&access_token={META_ACCESS_TOKEN}"
|
|
323
323
|
```
|
|
324
324
|
|
|
325
325
|
Se ainda vazio → WABA não existe. Guiar criação:
|
|
@@ -330,7 +330,7 @@ Se ainda vazio → WABA não existe. Guiar criação:
|
|
|
330
330
|
### FASE 5 — Descobrir Phone Numbers
|
|
331
331
|
|
|
332
332
|
```bash
|
|
333
|
-
curl "https://graph.facebook.com/
|
|
333
|
+
curl "https://graph.facebook.com/v25.0/{WABA_ID}/phone_numbers?fields=id,display_phone_number,verified_name,quality_rating,status,code_verification_status&access_token={META_ACCESS_TOKEN}"
|
|
334
334
|
```
|
|
335
335
|
|
|
336
336
|
Apresentar resultado:
|
|
@@ -355,10 +355,10 @@ Apresentar resultado:
|
|
|
355
355
|
#### 6.1 Solicitar código
|
|
356
356
|
```bash
|
|
357
357
|
# Via SMS (preferível)
|
|
358
|
-
curl -X POST "https://graph.facebook.com/
|
|
358
|
+
curl -X POST "https://graph.facebook.com/v25.0/{PHONE_ID}/request_code?code_method=SMS&language=pt_BR&access_token={META_ACCESS_TOKEN}"
|
|
359
359
|
|
|
360
360
|
# Via ligação (fallback se SMS falhar)
|
|
361
|
-
curl -X POST "https://graph.facebook.com/
|
|
361
|
+
curl -X POST "https://graph.facebook.com/v25.0/{PHONE_ID}/request_code?code_method=VOICE&language=pt_BR&access_token={META_ACCESS_TOKEN}"
|
|
362
362
|
```
|
|
363
363
|
|
|
364
364
|
**Respostas possíveis:**
|
|
@@ -376,7 +376,7 @@ curl -X POST "https://graph.facebook.com/v22.0/{PHONE_ID}/request_code?code_meth
|
|
|
376
376
|
|
|
377
377
|
#### 6.2 Confirmar código (quando usuário informar)
|
|
378
378
|
```bash
|
|
379
|
-
curl -X POST "https://graph.facebook.com/
|
|
379
|
+
curl -X POST "https://graph.facebook.com/v25.0/{PHONE_ID}/verify_code?code={CODIGO_6_DIGITOS}&access_token={META_ACCESS_TOKEN}"
|
|
380
380
|
```
|
|
381
381
|
Sucesso: `{"success": true}` — avançar.
|
|
382
382
|
Erro: código errado ou expirado — solicitar novo código (Fase 6.1 novamente).
|
|
@@ -431,7 +431,7 @@ APP_TOKEN="{META_APP_ID}|{META_APP_SECRET}"
|
|
|
431
431
|
WORKER_URL="https://$(grep SITE_DOMAIN server-edge-tracker/wrangler.toml | cut -d'"' -f2)"
|
|
432
432
|
|
|
433
433
|
# Registrar webhook
|
|
434
|
-
curl -X POST "https://graph.facebook.com/
|
|
434
|
+
curl -X POST "https://graph.facebook.com/v25.0/{META_APP_ID}/subscriptions" \
|
|
435
435
|
-d "object=whatsapp_business_account" \
|
|
436
436
|
-d "callback_url=${WORKER_URL}/webhook/whatsapp" \
|
|
437
437
|
-d "verify_token={WA_WEBHOOK_VERIFY_TOKEN}" \
|
|
@@ -445,7 +445,7 @@ Validar: `{"success": true}`
|
|
|
445
445
|
|
|
446
446
|
Confirmar com:
|
|
447
447
|
```bash
|
|
448
|
-
curl "https://graph.facebook.com/
|
|
448
|
+
curl "https://graph.facebook.com/v25.0/{META_APP_ID}/subscriptions?access_token=${APP_TOKEN}"
|
|
449
449
|
```
|
|
450
450
|
Deve retornar: `"active": true`, `"callback_url": "..."`, `"fields": [{"name": "messages", ...}]`
|
|
451
451
|
|
|
@@ -464,11 +464,11 @@ Deve retornar: `"active": true`, `"callback_url": "..."`, `"fields": [{"name": "
|
|
|
464
464
|
|
|
465
465
|
```bash
|
|
466
466
|
# Passo 1: subscrever campo messages no WABA
|
|
467
|
-
curl -X POST "https://graph.facebook.com/
|
|
467
|
+
curl -X POST "https://graph.facebook.com/v25.0/{WABA_ID}/subscribed_apps" \
|
|
468
468
|
-d "access_token={META_ACCESS_TOKEN}&subscribed_fields=messages"
|
|
469
469
|
|
|
470
470
|
# Passo 2: override de URL (garante que ESTA WABA use o worker, não o app genérico)
|
|
471
|
-
curl -X POST "https://graph.facebook.com/
|
|
471
|
+
curl -X POST "https://graph.facebook.com/v25.0/{WABA_ID}/subscribed_apps" \
|
|
472
472
|
-d "access_token={META_ACCESS_TOKEN}" \
|
|
473
473
|
-d "override_callback_uri=${WORKER_URL}/webhook/whatsapp" \
|
|
474
474
|
-d "verify_token={WA_WEBHOOK_VERIFY_TOKEN}" \
|
|
@@ -488,7 +488,7 @@ O override de URL é um recurso de BSP (Business Solution Providers — empresas
|
|
|
488
488
|
|
|
489
489
|
Verificar resultado final das subscriptions:
|
|
490
490
|
```bash
|
|
491
|
-
curl "https://graph.facebook.com/
|
|
491
|
+
curl "https://graph.facebook.com/v25.0/{WABA_ID}/subscribed_apps?access_token={META_ACCESS_TOKEN}"
|
|
492
492
|
```
|
|
493
493
|
Deve mostrar o app com `override_callback_uri` (se não-SMB) ou apenas o app subscrito (SMB).
|
|
494
494
|
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# ZapMan SDR Agent — CDP Edge
|
|
2
|
+
|
|
3
|
+
Você é o **Agente de Integração ZapMan SDR** do CDP Edge. Sua responsabilidade: **rotear leads do Worker (CTWA, formulários, /track) para o ZapMan SDR**, criando cards no Kanban e encaminhando webhooks da Meta para qualificação de leads via IA.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ✅ REGRAS CRÍTICAS
|
|
8
|
+
|
|
9
|
+
1. **Cloudflare-only** — sem dependências externas, roda no Worker.
|
|
10
|
+
2. **Silent fail** — se secrets ausentes, retorna sem quebrar o pipeline `/track`.
|
|
11
|
+
3. **Dois pontos de integração** — API REST (card no Kanban) + forward de webhook bruto (qualificação IA).
|
|
12
|
+
4. **Sem PII em logs** — `console.error` só com mensagem de erro, sem dados do lead.
|
|
13
|
+
5. **Versão fixa** — ZapMan API v1 (endpoint `/crm/leads`).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🔗 FLUXO DE ATIVAÇÃO
|
|
18
|
+
|
|
19
|
+
### 1. Lead via `/track` ou formulário
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Worker (/track — eventos Lead, Contact)
|
|
23
|
+
└─► ctx.waitUntil(pushLeadToZapmanCrm(env, leadData))
|
|
24
|
+
│
|
|
25
|
+
└─ POST {ZAPMAN_API_URL}/crm/leads
|
|
26
|
+
Headers: { X-API-Key: ZAPMAN_API_KEY }
|
|
27
|
+
Body: { telefone, nome, email, empresa, campanha, origem, instancia_id }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Lead via WhatsApp CTWA
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Meta WhatsApp Cloud API
|
|
34
|
+
└─► POST SEU_DOMINIO/webhook/whatsapp
|
|
35
|
+
│
|
|
36
|
+
├─ processWhatsAppWebhook() → Meta CAPI (evento Contact)
|
|
37
|
+
├─ pushLeadToZapmanCrm() → card no Kanban ZapMan
|
|
38
|
+
└─ forward rawBody → ZAPMAN_WEBHOOK_URL (qualificação SDR via IA)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🔑 SECRETS OBRIGATÓRIOS
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
wrangler secret put ZAPMAN_API_KEY # DASHBOARD_SECRET do ZapMan (X-API-Key)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Vars (wrangler.toml — por projeto)
|
|
50
|
+
|
|
51
|
+
```toml
|
|
52
|
+
ZAPMAN_API_URL = "https://zapman-api.arkitekt.space"
|
|
53
|
+
ZAPMAN_CRM_INSTANCE = "NOME_DA_INSTANCIA"
|
|
54
|
+
ZAPMAN_WEBHOOK_URL = "https://zapman-api.arkitekt.space/webhook/NOME_DA_INSTANCIA"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📊 CONTRATO DE PAYLOAD
|
|
60
|
+
|
|
61
|
+
### Card no Kanban (`POST {ZAPMAN_API_URL}/crm/leads`)
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"telefone": "+5511999998888",
|
|
66
|
+
"nome": "João Silva",
|
|
67
|
+
"email": "joao@exemplo.com",
|
|
68
|
+
"empresa": "Empresa XYZ",
|
|
69
|
+
"campanha": "black-friday-2026",
|
|
70
|
+
"origem": "whatsapp",
|
|
71
|
+
"instancia_id": "NOME_DA_INSTANCIA"
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Forward de Webhook WhatsApp (`POST ZAPMAN_WEBHOOK_URL`)
|
|
76
|
+
|
|
77
|
+
Payload bruto da Meta repassado integralmente — inclui `referral.ctwa_clid`, `referral.source_id`, `message.text.body` e todos os metadados do anúncio.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 🗂️ MÓDULO NO WORKER
|
|
82
|
+
|
|
83
|
+
**Arquivo:** `server-edge-tracker/modules/dispatch/crm.ts`
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
export async function pushLeadToZapmanCrm(env: Env, data: {
|
|
87
|
+
phone: string;
|
|
88
|
+
name?: string | null;
|
|
89
|
+
email?: string;
|
|
90
|
+
empresa?: string;
|
|
91
|
+
campanha?: string;
|
|
92
|
+
origem?: string;
|
|
93
|
+
}): Promise<void>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Ativado em:**
|
|
97
|
+
- `index.ts` — handler `/track` para eventos `Lead` e `Contact` com `payload.phone`
|
|
98
|
+
- `whatsapp.ts` — `processWhatsAppWebhook()` para leads CTWA
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🛡️ TRATAMENTO DE ERROS
|
|
103
|
+
|
|
104
|
+
| Cenário | Comportamento |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `ZAPMAN_API_URL` ou `ZAPMAN_API_KEY` ausentes | Retorna silenciosamente sem fetch |
|
|
107
|
+
| Erro de rede ou API não-200 | `console.error` + engole (pipeline não quebra) |
|
|
108
|
+
| `ZAPMAN_WEBHOOK_URL` ausente | Forward skippado silenciosamente |
|
|
109
|
+
| Erro no forward do webhook | `.catch(() => {})` — best-effort |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🧪 SMOKE TEST
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Simula lead CTWA chegando pelo webhook WhatsApp:
|
|
117
|
+
curl -s -X POST "https://SEU_DOMINIO/webhook/whatsapp" \
|
|
118
|
+
-H "Content-Type: application/json" \
|
|
119
|
+
-d '{
|
|
120
|
+
"object": "whatsapp_business_account",
|
|
121
|
+
"entry": [{
|
|
122
|
+
"id": "TEST",
|
|
123
|
+
"changes": [{
|
|
124
|
+
"field": "messages",
|
|
125
|
+
"value": {
|
|
126
|
+
"messaging_product": "whatsapp",
|
|
127
|
+
"contacts": [{"profile": {"name": "Teste"}, "wa_id": "5511999998888"}],
|
|
128
|
+
"messages": [{
|
|
129
|
+
"from": "5511999998888",
|
|
130
|
+
"id": "wamid.TESTE_001",
|
|
131
|
+
"timestamp": "1746500000",
|
|
132
|
+
"type": "text",
|
|
133
|
+
"text": {"body": "Olá, vi o anúncio!"},
|
|
134
|
+
"referral": {
|
|
135
|
+
"source_url": "https://SEU_DOMINIO",
|
|
136
|
+
"source_type": "ad",
|
|
137
|
+
"source_id": "120210001234567",
|
|
138
|
+
"headline": "Conheça nossos produtos",
|
|
139
|
+
"ctwa_clid": "ARAkLkA8nqFRK5_SIMULADO_001"
|
|
140
|
+
}
|
|
141
|
+
}]
|
|
142
|
+
}
|
|
143
|
+
}]
|
|
144
|
+
}]
|
|
145
|
+
}'
|
|
146
|
+
|
|
147
|
+
# Resposta esperada:
|
|
148
|
+
# {"ok":true,"processed":1,"results":[{"ok":true,"phone":"5511****","ctwa_clid":"present","event_id":"ctwa_..."}]}
|
|
149
|
+
# Verificar: card aparece no Kanban ZapMan com número e origem "whatsapp"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 🔧 INTEGRAÇÃO COM OUTROS AGENTES
|
|
155
|
+
|
|
156
|
+
- **WhatsApp CTWA Setup Agent** — configura webhook Meta apontando para `/webhook/whatsapp` do domínio
|
|
157
|
+
- **Server Tracking Agent** — chama `pushLeadToZapmanCrm` no handler `/track`
|
|
158
|
+
- **Lead Scoring Agent** — preenche `campanha` (utmCampaign) antes do envio
|
|
159
|
+
- **Webhook Agent** — forward do payload bruto da Meta para o SDR qualificar via IA
|
|
160
|
+
- **Memory Agent** — guarda `ZAPMAN_API_URL`, `ZAPMAN_CRM_INSTANCE` por projeto cliente
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 📋 CHECKLIST DE ATIVAÇÃO
|
|
165
|
+
|
|
166
|
+
- [ ] `wrangler secret put ZAPMAN_API_KEY` executado
|
|
167
|
+
- [ ] `ZAPMAN_API_URL`, `ZAPMAN_CRM_INSTANCE`, `ZAPMAN_WEBHOOK_URL` preenchidos no `wrangler.toml` do projeto
|
|
168
|
+
- [ ] URL do webhook Meta configurada para `https://SEU_DOMINIO/webhook/whatsapp`
|
|
169
|
+
- [ ] `WA_WEBHOOK_VERIFY_TOKEN` configurado e validado pelo Meta
|
|
170
|
+
- [ ] Rota `SEU_DOMINIO/webhook/*` ativa no Worker (wrangler.toml)
|
|
171
|
+
- [ ] Smoke test retorna `{"ok":true,"processed":1,...}`
|
|
172
|
+
- [ ] Card aparece no Kanban ZapMan com telefone e origem corretos
|
|
173
|
+
- [ ] Forward do webhook chega na instância ZapMan SDR para qualificação IA
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 🎯 ARQUITETURA Quantum Tier
|
|
178
|
+
|
|
179
|
+
| Pilar | Garantia |
|
|
180
|
+
|---|---|
|
|
181
|
+
| **Não-bloqueante** | `ctx.waitUntil` — `/track` responde em <50ms mesmo com ZapMan lento |
|
|
182
|
+
| **Dual-channel** | API REST (card imediato) + webhook forward (qualificação IA) |
|
|
183
|
+
| **Idempotente** | Worker deduplica por `wamid` antes de disparar |
|
|
184
|
+
| **Multi-tenant** | Cada projeto usa seus próprios secrets e instância ZapMan |
|
|
185
|
+
| **Zero PII em logs** | Apenas mensagem de erro, sem telefone ou nome |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
> 📋 **Sua Função:** Garantir que todo lead capturado pelo CDP Edge (CTWA, formulário, /track) chegue no Kanban do ZapMan SDR com telefone, nome, email, empresa e campanha preenchidos, e que o payload bruto da Meta seja encaminhado para a instância SDR processar via IA — com fallback silencioso quando os secrets não estão configurados.
|
|
@@ -409,7 +409,7 @@ export function getUserIdWithFallback() {
|
|
|
409
409
|
*
|
|
410
410
|
* Dispara evento para:
|
|
411
411
|
* - Worker (server-side)
|
|
412
|
-
* - Meta CAPI
|
|
412
|
+
* - Meta CAPI v25.0 (se configurado)
|
|
413
413
|
* - Google GA4 Measurement Protocol (se configurado)
|
|
414
414
|
* - TikTok Events API v1.3 (se configurado)
|
|
415
415
|
*
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
"versions": {
|
|
17
17
|
"pixel": {
|
|
18
|
-
"current": "
|
|
18
|
+
"current": "v25.0",
|
|
19
19
|
"minimum_supported": "v21.0",
|
|
20
|
-
"recommended": "
|
|
20
|
+
"recommended": "v25.0",
|
|
21
21
|
"deprecated": ["v20.0", "v21.0"],
|
|
22
22
|
"deprecated_cutoff": {
|
|
23
23
|
"v20.0": "2024-01-01T00:00:00.000Z",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
"capi": {
|
|
29
|
-
"current": "
|
|
29
|
+
"current": "v25.0",
|
|
30
30
|
"minimum_supported": "v21.0",
|
|
31
|
-
"recommended": "
|
|
31
|
+
"recommended": "v25.0",
|
|
32
32
|
"endpoint_pattern": "https://graph.facebook.com/{VERSION}/{PIXEL_ID}/events",
|
|
33
33
|
"authentication": "Bearer token (META_ACCESS_TOKEN)",
|
|
34
34
|
"rate_limits": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
"messenger": {
|
|
42
|
-
"current": "
|
|
42
|
+
"current": "v25.0",
|
|
43
43
|
"minimum_supported": "v21.0",
|
|
44
|
-
"recommended": "
|
|
45
|
-
"whatsapp_cloud_api": "
|
|
44
|
+
"recommended": "v25.0",
|
|
45
|
+
"whatsapp_cloud_api": "v25.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
},
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
"new_parameters": [],
|
|
323
323
|
"deprecated_parameters": [],
|
|
324
324
|
"migration_steps": [
|
|
325
|
-
"Atualizar endpoint de /v20.0/ para /
|
|
325
|
+
"Atualizar endpoint de /v20.0/ para /v25.0/",
|
|
326
326
|
"Verificar novos parâmetros obrigatórios",
|
|
327
327
|
"Testar em ambiente de sandbox"
|
|
328
328
|
]
|
|
@@ -64,7 +64,7 @@ SITE DO CLIENTE
|
|
|
64
64
|
▼
|
|
65
65
|
CLOUDFLARE WORKER (Supreme Edge)
|
|
66
66
|
│
|
|
67
|
-
├──→ META CAPI
|
|
67
|
+
├──→ META CAPI v25.0 ──────── Atribuição de Meta Ads
|
|
68
68
|
├──→ TikTok Events API ────── Atribuição de TikTok Ads
|
|
69
69
|
├──→ GA4 Measurement Protocol ─ Relatórios Google
|
|
70
70
|
└──→ D1 Database ───────────── Atribuição e Identity Graph
|
|
@@ -93,7 +93,7 @@ CLOUDFLARE WORKER (Supreme Edge)
|
|
|
93
93
|
▼ ▼ ▼
|
|
94
94
|
┌─────────────────┐ ┌───────────────┐ ┌─────────────────────┐
|
|
95
95
|
│ META CAPI │ │ CLOUDFLARE │ │ CLOUDFLARE QUEUES │
|
|
96
|
-
│
|
|
96
|
+
│ v25.0 │ │ D1 DATABASE │ │ (Async Processes) │
|
|
97
97
|
│ │ │ │ │ │
|
|
98
98
|
│ Facebook Ads ✅ │ │ leads │ │ Retries & Logging │
|
|
99
99
|
│ Instagram Ads ✅│ │ user_profiles │ │ High Resilience │
|