cdp-edge 1.12.0 → 1.14.0

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.
@@ -0,0 +1,196 @@
1
+ # A/B LTV Testing Agent — CDP Edge Quantum Tier
2
+
3
+ ## Identidade
4
+
5
+ **Agente:** A/B LTV Testing Agent
6
+ **Papel:** Otimização Contínua de Precisão do LTV Preditivo
7
+ **Nível:** Deus (Quantum Tier) — Enterprise-Level Fase 3
8
+ **Versão:** 1.0.0 — 9 de Abril de 2026
9
+
10
+ ---
11
+
12
+ ## Missão
13
+
14
+ Testar variações do prompt do modelo de LTV de forma automática e estatisticamente controlada,
15
+ identificando qual formulação do sistema prompt para o Workers AI produz as predições mais
16
+ próximas do valor real de compra — **aumentando a precisão do LTV em até +25%**.
17
+
18
+ ---
19
+
20
+ ## Posição no Fluxo do Master Orchestrator
21
+
22
+ ```
23
+ Browser /track (Lead Event)
24
+
25
+ LTV Prediction Call (predictLtv)
26
+ ↓ [se teste ativo]
27
+ getLtvAbVariation() → sorteia variação ponderada do teste ativo
28
+
29
+ Workers AI com system_prompt da variação sorteada
30
+
31
+ D1: ltv_ab_assignments (registra user_id + variation_id + predicted_ltv)
32
+
33
+ [quando compra chega via webhook]
34
+ D1: ltv_ab_assignments.converted = 1 + real_revenue
35
+
36
+ GET /api/ltv/ab-test/results → accuracy_score por variação
37
+
38
+ POST /api/ltv/ab-test/winner → aplica vencedor ao LTV padrão
39
+ ```
40
+
41
+ **Upstream (de onde recebe dados):**
42
+ - `worker.js → predictLtv()` — ponto de interceptação do teste
43
+ - `webhook events` — fonte verdade do revenue real para scoring
44
+
45
+ **Downstream (quem consome outputs):**
46
+ - `ltv-predictor-agent.md` → recebe o prompt vencedor para aplicar como novo default
47
+ - `bidding-agent.md` → LTV mais preciso → bids mais precisos
48
+ - `dashboard-agent.md` → exibe resultados dos testes no painel
49
+
50
+ ---
51
+
52
+ ## Como o A/B Test Funciona
53
+
54
+ ### 1. Criação do Experimento
55
+
56
+ ```
57
+ POST /api/ltv/ab-test/create
58
+ {
59
+ "name": "Teste: Foco Engajamento vs Intenção",
60
+ "min_sample": 200,
61
+ "variations": [
62
+ {
63
+ "name": "Controle — Prompt Original",
64
+ "is_control": true,
65
+ "weight": 0.5,
66
+ "system_prompt": "You are a conversion rate expert. Reply ONLY with JSON {\"adjustment\": <-10 to 10>} based on lead data. No explanation."
67
+ },
68
+ {
69
+ "name": "Variação B — Foco em Intenção de Compra",
70
+ "weight": 0.5,
71
+ "system_prompt": "You are a Brazilian digital marketing expert specializing in course sales. Focus on purchase intention signals. Reply ONLY with JSON {\"adjustment\": <-10 to 10>}."
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ ### 2. Distribuição Automática
78
+
79
+ A cada chamada de `predictLtv()` para um evento Lead, o sistema:
80
+ 1. Busca o teste ativo no D1 (com cache de 5 min no KV para evitar latência)
81
+ 2. Sorteia uma variação usando distribuição ponderada pelos `weight`
82
+ 3. Usa o `system_prompt` da variação sorteada no Workers AI
83
+ 4. Registra o assignment em `ltv_ab_assignments`
84
+
85
+ ### 3. Scoring Automático via Webhook
86
+
87
+ Quando chega um webhook de compra (`Purchase`), o sistema:
88
+ 1. Busca o email do comprador em `ltv_ab_assignments` (por hash)
89
+ 2. Atualiza `converted = 1` e `real_revenue = valor_da_compra`
90
+ 3. Incrementa `total_purchases` e `sum_real_revenue` na variação
91
+
92
+ ### 4. Cálculo de Accuracy Score
93
+
94
+ ```
95
+ accuracy_score =
96
+ 1 - (ABS(avg_predicted_ltv - avg_real_revenue) / avg_real_revenue)
97
+ → 1.0 = predição perfeita
98
+ → 0.0 = predição completamente errada
99
+ → Valores negativos = predição muito errada
100
+ ```
101
+
102
+ ### 5. Declaração de Vencedor
103
+
104
+ ```
105
+ POST /api/ltv/ab-test/winner
106
+ { "test_id": 1, "variation_id": 2 }
107
+ → marca variation como winner
108
+ → retorna o system_prompt vencedor para aplicar como novo default
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Endpoints Expostos
114
+
115
+ | Método | Rota | Função |
116
+ |--------|------|--------|
117
+ | `POST` | `/api/ltv/ab-test/create` | Cria novo experimento com variações |
118
+ | `GET` | `/api/ltv/ab-test/list` | Lista todos os experimentos |
119
+ | `GET` | `/api/ltv/ab-test/results` | Resultados de accuracy por variação |
120
+ | `POST` | `/api/ltv/ab-test/winner` | Declara vencedor e retorna prompt |
121
+
122
+ ---
123
+
124
+ ## Variações de Prompt Predefinidas (use nos seus testes)
125
+
126
+ ### Variação A — Controle (atual)
127
+ ```text
128
+ You are a conversion rate expert. Reply ONLY with a JSON object
129
+ {"adjustment": <number between -10 and 10>} based on the lead data provided.
130
+ No explanation.
131
+ ```
132
+
133
+ ### Variação B — Foco em Intenção
134
+ ```text
135
+ You are a Brazilian infoproduct marketing expert. The lead is likely interested in
136
+ online courses or digital products. Focus heavily on purchase_intention and
137
+ engagement signals. Reply ONLY with JSON {"adjustment": <-10 to 10>}.
138
+ Higher adjustment = higher purchase probability.
139
+ ```
140
+
141
+ ### Variação C — Foco em Dados Comportamentais
142
+ ```text
143
+ You are a behavioral economics expert. Analyze recency, frequency, and monetary
144
+ signals from the lead data. Score based on: (1) engagement quality, (2) time of
145
+ conversion, (3) traffic source quality. Reply ONLY with JSON {"adjustment": <-10 to 10>}.
146
+ ```
147
+
148
+ ### Variação D — Foco em Geo + Canal
149
+ ```text
150
+ You are a CRM specialist for Brazilian digital products. Brazilian leads from paid
151
+ social (facebook/instagram) between 18h-23h BRT have highest LTV. Organic traffic
152
+ and direct access indicate research phase. Reply ONLY with JSON {"adjustment": <-10 to 10>}.
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Regras de Negócio
158
+
159
+ ```
160
+ ✅ SEMPRE manter o controle ativo (is_control = 1) — baseline para comparação
161
+ ✅ SEMPRE aguardar min_sample assignments antes de recomendar vencedor
162
+ ✅ SEMPRE registrar assignments mesmo quando Workers AI está indisponível
163
+ ✅ SEMPRE usar cache KV (5 min TTL) para buscar o teste ativo — evitar latência D1
164
+ ✅ SEMPRE atualizar assignments quando purchase webhook chegar
165
+
166
+ ❌ NUNCA declarar vencedor com < 50 conversões por variação
167
+ ❌ NUNCA rodar dois testes simultâneos (status = 'running' deve ser único)
168
+ ❌ NUNCA alterar o prompt default automaticamente — sempre exigir aprovação manual via POST /winner
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Schema D1 — Tabelas
174
+
175
+ ```sql
176
+ ltv_ab_tests -- Experimentos (id, name, status, winner_id, min_sample)
177
+ ltv_ab_variations -- Variações de prompt por experimento
178
+ ltv_ab_assignments -- Registro de qual variação foi usada por lead
179
+ v_ab_test_performance -- VIEW: accuracy por variação com métricas consolidadas
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Variáveis de Ambiente Requeridas
185
+
186
+ | Variável | Binding | Descrição |
187
+ |----------|---------|-----------|
188
+ | `DB` | D1 | Tabelas ltv_ab_tests, ltv_ab_variations, ltv_ab_assignments |
189
+ | `AI` | Workers AI | Executa as variações de prompt |
190
+ | `GEO_CACHE` | KV | Cache do teste ativo (TTL: 5 min) |
191
+
192
+ *(Nenhum secret externo necessário)*
193
+
194
+ ---
195
+
196
+ *Agente criado em conformidade com a arquitetura Quantum Tier CDP Edge — 9 de Abril de 2026*
@@ -0,0 +1,347 @@
1
+ # Bidding Recommendations Agent — CDP Edge Quantum Tier
2
+
3
+ ## Identidade
4
+
5
+ **Agente:** Bidding Recommendations Agent
6
+ **Papel:** Especialista em Otimização Automática de Bids via ML
7
+ **Nível:** Deus (Quantum Tier) — Enterprise-Level Fase 2
8
+ **Versão:** 1.0.0 — 9 de Abril de 2026
9
+
10
+ ---
11
+
12
+ ## Missão
13
+
14
+ Transformar dados de segmentação ML (ml_segments) e predições de LTV (leads.predicted_ltv, leads.ltv_class)
15
+ em **recomendações automatizadas de lances** para cada plataforma de anúncios, eliminando a tomada de
16
+ decisão manual e reduzindo o custo de aquisição em até -20%.
17
+
18
+ ---
19
+
20
+ ## Posição no Fluxo do Master Orchestrator
21
+
22
+ ```
23
+ LTV Predictor Agent ──┐
24
+ ├──► Bidding Recommendations Agent ──► Recomendações ativas
25
+ ML Clustering Agent ──┘
26
+ ↓ consome
27
+ POST /api/bidding/recommend
28
+ ↓ persiste
29
+ D1: bid_recommendations (tabela)
30
+ ↓ expõe
31
+ GET /api/bidding/history (histórico)
32
+ GET /api/bidding/status (status atual por campanha)
33
+ ```
34
+
35
+ **Upstream (de onde recebe dados):**
36
+ - `ml-clustering-agent.md` → tabela `ml_segments` (segmentos com avg_ltv, avg_engagement, etc.)
37
+ - `ltv-predictor-agent.md` → tabela `leads` (predicted_ltv, ltv_class)
38
+
39
+ **Downstream (quem consome outputs):**
40
+ - `meta-agent.md` → lê recomendações de bid para Meta Ads / Advantage+ Budget
41
+ - `google-agent.md` → lê recomendações de bid para Google Ads Smart Bidding
42
+ - `tiktok-agent.md` → lê recomendações de bid para TikTok Campaign Budget
43
+ - `dashboard-agent.md` → exibe recomendações no painel visual
44
+
45
+ ---
46
+
47
+ ## O que este agente configura
48
+
49
+ ```
50
+ Bidding Recommendations Engine
51
+ ├── Análise de dados históricos (D1: leads, ml_segments, ml_segment_members)
52
+ ├── Cálculo de CPA médio real por segmento
53
+ ├── Cálculo de ROAS esperado por segmento
54
+ ├── Recomendação de bid por plataforma (Meta, Google, TikTok)
55
+ ├── Cálculo de confiança (0-1) baseado em volume de dados
56
+ ├── Persistência das recomendações no D1
57
+ └── Workers AI para análise de verticais específicas
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Responsabilidades
63
+
64
+ 1. **Analisar** o LTV médio por segmento ML (lendo `ml_segments` + `leads`)
65
+ 2. **Calcular** CPA alvo por segmento (ex: se LTV médio = R$ 500 e ROI alvo = 3x → CPA alvo = R$ 166)
66
+ 3. **Recomendar** bid otimizado por plataforma com confiança ponderada pelo volume de dados
67
+ 4. **Persistir** recomendações no D1 com histórico completo
68
+ 5. **Alertar** quando dados insuficientes (< 30 conversões no período)
69
+
70
+ ---
71
+
72
+ ## Inputs do Orquestrador
73
+
74
+ | Campo | Tipo | Descrição |
75
+ |-------|------|-----------|
76
+ | `vertical` | string | Vertical do cliente (`curso-online`, `ecommerce`, `saas`, `infoproduto`) |
77
+ | `platform` | string | Plataforma alvo (`meta`, `google`, `tiktok`, `all`) |
78
+ | `target_roi` | number | ROI alvo desejado (ex: `3.5` = 350% de retorno) |
79
+ | `period_days` | number | Janela de análise em dias (default: `30`) |
80
+ | `campaign_id` | string | (Opcional) ID externo da campanha para referência |
81
+ | `budget` | number | (Opcional) Orçamento mensal em BRL para calibrar volume |
82
+
83
+ ---
84
+
85
+ ## Outputs para o Server Architect
86
+
87
+ | Item | Descrição |
88
+ |------|-----------|
89
+ | Rota `POST /api/bidding/recommend` | Gera recomendações novas com base nos dados atuais |
90
+ | Rota `GET /api/bidding/history` | Histórico de recomendações anteriores |
91
+ | Rota `GET /api/bidding/status` | Status atual das recomendações por vertical/plataforma |
92
+ | Tabela D1 `bid_recommendations` | Persistência das recomendações geradas |
93
+
94
+ ---
95
+
96
+ ## Lógica de Recomendação
97
+
98
+ ### Fórmula Base de Bid Ótimo
99
+
100
+ ```
101
+ CPA_alvo = LTV_médio_segmento / ROI_alvo
102
+ Bid_recomendado = CPA_alvo × fator_plataforma × ajuste_confiança
103
+
104
+ Onde:
105
+ fator_plataforma:
106
+ Meta Ads → 0.85 (Meta usa CPA automático, bid = CPM guide)
107
+ Google Ads → 0.90 (Smart Bidding converge em ~2 semanas)
108
+ TikTok Ads → 0.75 (Algoritmo mais volátil, bids conservadores)
109
+
110
+ ajuste_confiança:
111
+ confidence < 0.4 → bid × 0.70 (dados insuficientes, bids conservadores)
112
+ confidence 0.4–0.7 → bid × 0.85
113
+ confidence > 0.7 → bid × 1.00 (dados sólidos, bid cheio)
114
+ ```
115
+
116
+ ### Cálculo de Confiança
117
+
118
+ ```javascript
119
+ confidence = Math.min(1, conversions_count / 100)
120
+ // 0 conversões = 0.0 (sem dados)
121
+ // 30 conversões = 0.30 (baixo)
122
+ // 70 conversões = 0.70 (médio)
123
+ // 100+ conversões = 1.0 (alto)
124
+ ```
125
+
126
+ ### Classificação de Segmento para Bid
127
+
128
+ ```
129
+ Segmento "Alto Valor + Alto Engajamento" → bid_multiplier = 1.4 (agressivo)
130
+ Segmento "Alto Valor + Médio Engajamento" → bid_multiplier = 1.2 (moderado)
131
+ Segmento "Médio Valor + Alto Engajamento" → bid_multiplier = 1.0 (base)
132
+ Segmento "Baixo Valor + Alto Engajamento" → bid_multiplier = 0.8 (conservador)
133
+ Segmento "Qualquer + Baixo Engajamento" → bid_multiplier = 0.6 (mínimo)
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Formato de Output (Response JSON)
139
+
140
+ ```json
141
+ {
142
+ "success": true,
143
+ "generated_at": "2026-04-09T17:59:10.000Z",
144
+ "vertical": "infoproduto",
145
+ "period_days": 30,
146
+ "target_roi": 3.5,
147
+ "data_quality": {
148
+ "leads_analyzed": 1247,
149
+ "conversions_found": 89,
150
+ "segments_active": 5,
151
+ "confidence": 0.89
152
+ },
153
+ "recommendations": [
154
+ {
155
+ "platform": "meta",
156
+ "segment": "Alto Valor + Alto Engajamento",
157
+ "segment_id": 1,
158
+ "avg_ltv": 497.00,
159
+ "avg_ltv_class": "High",
160
+ "cpa_target": 142.00,
161
+ "recommended_bid": 145.50,
162
+ "bid_currency": "BRL",
163
+ "confidence": 0.89,
164
+ "expected_roi": 3.41,
165
+ "reasoning": "Segmento com LTV médio R$ 497 e engajamento alto. CPA alvo calculado em R$ 142 para ROI 3.5x. Meta fator 0.85 aplicado. Dados de 89 conversões.",
166
+ "alert": null
167
+ },
168
+ {
169
+ "platform": "google",
170
+ "segment": "Médio Valor + Alto Engajamento",
171
+ "segment_id": 3,
172
+ "avg_ltv": 297.00,
173
+ "avg_ltv_class": "Medium",
174
+ "cpa_target": 84.86,
175
+ "recommended_bid": 76.37,
176
+ "bid_currency": "BRL",
177
+ "confidence": 0.72,
178
+ "expected_roi": 3.89,
179
+ "reasoning": "Segmento de LTV médio com alto engajamento. CPA conservador aplicado por confiança 0.72.",
180
+ "alert": null
181
+ }
182
+ ],
183
+ "global_summary": {
184
+ "total_platforms": 2,
185
+ "avg_confidence": 0.81,
186
+ "expected_cost_reduction": "-18%",
187
+ "segments_analyzed": 5
188
+ }
189
+ }
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Regras de Negócio Críticas
195
+
196
+ ```
197
+ ✅ SEMPRE calcular bid com base no LTV real do D1 — nunca inventar valores
198
+ ✅ SEMPRE incluir o campo `reasoning` explicando a lógica do bid
199
+ ✅ SEMPRE incluir `confidence` ponderado pelo volume de conversões
200
+ ✅ SEMPRE alertar quando conversions_found < 30 (dados insuficientes)
201
+ ✅ SEMPRE registrar recomendações no D1 tabela bid_recommendations
202
+
203
+ ❌ NUNCA sugerir bid acima de LTV/2 (risco de ROI negativo)
204
+ ❌ NUNCA recomendar bid sem pelo menos 10 leads no período
205
+ ❌ NUNCA ignorar o fator de plataforma no cálculo final
206
+ ```
207
+
208
+ ---
209
+
210
+ ## Integração com ml-clustering-agent
211
+
212
+ O Bidding Agent **depende diretamente** do ML Clustering Agent:
213
+
214
+ ```sql
215
+ -- Query que o Bidding Agent usa para obter LTV por segmento
216
+ SELECT
217
+ ms.id AS segment_id,
218
+ ms.cluster_name AS segment,
219
+ ms.avg_ltv_class,
220
+ ms.avg_behavior_score,
221
+ ms.avg_engagement_score,
222
+ ms.silhouette_score,
223
+ COUNT(msm.lead_id) AS member_count,
224
+ AVG(l.predicted_ltv) AS real_avg_ltv,
225
+ SUM(CASE WHEN l.event_name IN ('Purchase','CompletePayment') THEN 1 ELSE 0 END) AS conversions
226
+ FROM ml_segments ms
227
+ JOIN ml_segment_members msm ON msm.cluster_id = ms.id
228
+ JOIN leads l ON CAST(msm.lead_id AS INTEGER) = l.id
229
+ WHERE ms.is_active = 1
230
+ AND ms.client_vertical = :vertical
231
+ AND l.created_at >= datetime('now', '-' || :period_days || ' days')
232
+ GROUP BY ms.id
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Integração com ltv-predictor-agent
238
+
239
+ ```sql
240
+ -- Query secundária para calibrar predição com valores reais
241
+ SELECT
242
+ predicted_ltv_class,
243
+ AVG(predicted_ltv) AS avg_predicted,
244
+ COUNT(*) AS count
245
+ FROM leads
246
+ WHERE created_at >= datetime('now', '-90 days')
247
+ AND predicted_ltv IS NOT NULL
248
+ GROUP BY predicted_ltv_class
249
+ ```
250
+
251
+ ---
252
+
253
+ ## Schema D1 — Tabela `bid_recommendations`
254
+
255
+ ```sql
256
+ CREATE TABLE IF NOT EXISTS bid_recommendations (
257
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
258
+ generated_at TEXT NOT NULL DEFAULT (datetime('now')),
259
+ vertical TEXT NOT NULL,
260
+ platform TEXT NOT NULL, -- 'meta', 'google', 'tiktok', 'all'
261
+ segment_id INTEGER, -- FK para ml_segments.id
262
+ segment_name TEXT,
263
+ period_days INTEGER NOT NULL,
264
+ target_roi REAL NOT NULL,
265
+
266
+ -- Resultado da análise
267
+ leads_analyzed INTEGER NOT NULL,
268
+ conversions_found INTEGER NOT NULL,
269
+ avg_ltv REAL,
270
+ cpa_target REAL,
271
+ recommended_bid REAL,
272
+ bid_currency TEXT DEFAULT 'BRL',
273
+ confidence REAL,
274
+ expected_roi REAL,
275
+ reasoning TEXT,
276
+ alert_message TEXT,
277
+
278
+ -- Status
279
+ is_active INTEGER DEFAULT 1,
280
+
281
+ -- Auditoria
282
+ applied_at TEXT, -- Quando o usuário aplicou o bid
283
+ applied_result TEXT -- JSON: resultado após aplicação (clicks, conversions, real_roi)
284
+ );
285
+
286
+ CREATE INDEX IF NOT EXISTS idx_bid_recs_vertical ON bid_recommendations(vertical);
287
+ CREATE INDEX IF NOT EXISTS idx_bid_recs_platform ON bid_recommendations(platform);
288
+ CREATE INDEX IF NOT EXISTS idx_bid_recs_generated ON bid_recommendations(generated_at);
289
+ CREATE INDEX IF NOT EXISTS idx_bid_recs_active ON bid_recommendations(is_active);
290
+ ```
291
+
292
+ ---
293
+
294
+ ## Variáveis de Ambiente Requeridas
295
+
296
+ | Variável | Binding Cloudflare | Descrição |
297
+ |----------|--------------------|-----------|
298
+ | `DB` | D1 | Banco principal com leads, ml_segments, bid_recommendations |
299
+ | `AI` | Workers AI | Para análise de verticais não mapeadas |
300
+
301
+ *(Sem secrets externos necessários — opera 100% com dados internos do D1)*
302
+
303
+ ---
304
+
305
+ ## Limitações e Boas Práticas
306
+
307
+ | Cenário | Comportamento |
308
+ |---------|---------------|
309
+ | `leads < 10` no período | Retorna `error: dados insuficientes` |
310
+ | `conversions < 30` | Retorna bid com `confidence < 0.3` e alerta no body |
311
+ | `ml_segments` vazio | Usa LTV global dos leads sem segmentação |
312
+ | Workers AI indisponível | Usa fórmula determinística (sem AI), marca `ai_used: false` |
313
+
314
+ ---
315
+
316
+ ## Exemplos de Uso
317
+
318
+ ```bash
319
+ # Gerar recomendações para Meta, vertical infoproduto, ROI alvo 3.5x
320
+ POST /api/bidding/recommend
321
+ {
322
+ "vertical": "infoproduto",
323
+ "platform": "meta",
324
+ "target_roi": 3.5,
325
+ "period_days": 30
326
+ }
327
+
328
+ # Gerar recomendações para todas as plataformas
329
+ POST /api/bidding/recommend
330
+ {
331
+ "vertical": "ecommerce",
332
+ "platform": "all",
333
+ "target_roi": 4.0,
334
+ "period_days": 60,
335
+ "budget": 10000
336
+ }
337
+
338
+ # Ver histórico de recomendações
339
+ GET /api/bidding/history?vertical=infoproduto&platform=meta&limit=10
340
+
341
+ # Status atual das recomendações ativas
342
+ GET /api/bidding/status?vertical=infoproduto
343
+ ```
344
+
345
+ ---
346
+
347
+ *Agente criado em conformidade com a arquitetura Quantum Tier CDP Edge — 9 de Abril de 2026*
@@ -27,10 +27,10 @@ Enquanto o `server-tracking-agent` define **o que o Worker FAZ**, você define *
27
27
  ### Worker Ativo
28
28
  ```
29
29
  Nome: server-edge-tracker
30
- URL: https://server-edge-tracker.suporte-ed9.workers.dev
31
- Account: suporte@kadoshmkt.com.br
32
- ID: ed96c1aa212ab5ab2e97e522b9a0b49b
33
- Deploy: 2026-03-29 (último)
30
+ URL: https://SEU_WORKER.SEU_USUARIO.workers.dev
31
+ Account: SEU_EMAIL@SEUDOMINIO.com.br
32
+ ID: SEU_CLOUDFLARE_ACCOUNT_ID
33
+ Deploy: (data do último deploy)
34
34
  ```
35
35
 
36
36
  ### `wrangler.toml` — Estado Real
@@ -45,13 +45,13 @@ compatibility_flags = ["nodejs_compat"]
45
45
  META_PIXEL_ID = "SEU_PIXEL_ID"
46
46
  GA4_MEASUREMENT_ID = "G-XXXXXXXXXX"
47
47
  TIKTOK_PIXEL_ID = "CXXXXXXXXXXXXXXX"
48
- SITE_DOMAIN = "server-edge-tracker.suporte-ed9.workers.dev"
48
+ SITE_DOMAIN = "SEU_DOMINIO"
49
49
 
50
50
  # ── D1 Database ───────────────────────────────────────────────────────────────
51
51
  [[d1_databases]]
52
52
  binding = "DB"
53
53
  database_name = "cdp-edge-db"
54
- database_id = "7867d38f-5fa8-4c17-b465-386211422c09"
54
+ database_id = "SEU_D1_DATABASE_ID"
55
55
 
56
56
  # ── Workers AI ────────────────────────────────────────────────────────────────
57
57
  [ai]
@@ -67,7 +67,7 @@ crons = ["0 2 * * 7", "0 3 1 * *"]
67
67
  ## 🗄️ BINDING 1 — D1 DATABASE (`env.DB`)
68
68
 
69
69
  ### Banco: `cdp-edge-db`
70
- - **ID:** `7867d38f-5fa8-4c17-b465-386211422c09`
70
+ - **ID:** `SEU_D1_DATABASE_ID`
71
71
  - **Região:** ENAM (US East)
72
72
  - **Engine:** SQLite (Cloudflare D1)
73
73
  - **Tabelas ativas:** 8