cdp-edge 2.2.0 → 2.2.2
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 +25 -8
- package/extracted-skill/tracking-events-generator/agents/database-agent.md +5 -4
- package/extracted-skill/tracking-events-generator/agents/fraud-detection-agent.md +0 -1
- package/extracted-skill/tracking-events-generator/agents/linkedin-agent.md +1 -1
- package/extracted-skill/tracking-events-generator/agents/ltv-predictor-agent.md +4 -4
- package/extracted-skill/tracking-events-generator/agents/ml-clustering-agent.md +81 -70
- package/extracted-skill/tracking-events-generator/agents/page-analyzer.md +6 -2
- package/extracted-skill/tracking-events-generator/models/lancamento-imobiliario.md +344 -0
- package/package.json +1 -1
- package/server-edge-tracker/index.js +1 -1
- package/server-edge-tracker/modules/ml/fraud.js +1 -16
- package/server-edge-tracker/modules/ml/ltv.js +7 -1
- package/server-edge-tracker/modules/ml/segmentation.js +157 -127
- package/server-edge-tracker/modules/utils.js +5 -3
- package/server-edge-tracker/worker.js +190 -122
- package/server-edge-tracker/wrangler.toml +22 -4
- package/templates/lancamento-imobiliario.md +344 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Padrão Quantum Tracking: 100% Cloudflare Edge.** Sem GTM. Sem Stape. Sem cookies de terceiros.
|
|
4
4
|
|
|
5
|
-
> **v2.0
|
|
5
|
+
> **v2.2.0** — Granite 4.0 Micro · K-means Vetorial Real (bge-m3) · Sem emails descartáveis · Cloudflare Workers · Meta CAPI v22.0 · GA4 MP · TikTok Events API v1.3
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Meu ecossistema opera como um Cérebro de Conversão Privado na borda. Quando um evento de Lead bate no endpoint `/track`:
|
|
15
15
|
1. **O Escudo Frontal (Fraud Gate):** Inspeciono IP, ASN e Velocity na borda. Bloqueio bots silenciosamente antes mesmo deles carregarem.
|
|
16
16
|
2. **A Roleta Invisível (A/B LTV):** Faço o sorteio de prompts para testes A/B via KV Cache em ~0ms.
|
|
17
|
-
3. **O Cérebro Financeiro (LTV Predictor):** Rodo Machine Learning (
|
|
17
|
+
3. **O Cérebro Financeiro (LTV Predictor):** Rodo Machine Learning (Granite 4.0 Micro) para qualificar a intenção e gerar o LTV Preditivo.
|
|
18
18
|
4. **Envio para as Plataformas:** O Facebook/Google/LinkedIn recebem um payload limpo (sem bot) recheado com valor financeiro de intenção extrema.
|
|
19
19
|
5. **Máquina Autônoma (Background):** Meu banco SQLite (D1) retroalimenta os processos de Clustering (Fase 1) e Bidding (Fase 2) de forma autônoma pelas costas do usuário (`ctx.waitUntil`).
|
|
20
20
|
|
|
@@ -25,6 +25,25 @@ Meu ecossistema opera como um Cérebro de Conversão Privado na borda. Quando um
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
## 📋 CHANGELOG v2.2.0 (10 de Abril de 2026)
|
|
29
|
+
|
|
30
|
+
### 🤖 AI Engine Upgrade — Novos Modelos
|
|
31
|
+
|
|
32
|
+
- **LTV Prediction**: `@cf/meta/llama-3.1-8b-instruct` → **`@cf/ibm-granite/granite-4.0-h-micro`** (menor latência, otimizado para edge e function calling)
|
|
33
|
+
- **ML Clustering**: algoritmo LLM simulado → **K-means vetorial real** com embeddings `@cf/baai/bge-m3` (distância cosseno, K-means++ inicialização, silhouette score real)
|
|
34
|
+
- Granite continua sendo usado para naming dos segmentos pós-clustering
|
|
35
|
+
|
|
36
|
+
### 🧹 Limpeza (Zero Lixo)
|
|
37
|
+
|
|
38
|
+
- Removido: detecção de emails descartáveis (mailinator, guerrilla, tempmail, etc.) do Fraud Gate e do agente `fraud-detection-agent.md`
|
|
39
|
+
- Removido: secrets `WEBHOOK_SECRET_HOTMART` e `WEBHOOK_SECRET_KIWIFY` (wrangler + wrangler.toml)
|
|
40
|
+
|
|
41
|
+
### 🔧 Observability
|
|
42
|
+
|
|
43
|
+
- Adicionado bloco `[observability]` no `wrangler.toml` (`logs.enabled = true`, `traces.enabled = false`)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
28
47
|
## 📋 CHANGELOG v2.0.7 (10 de Abril de 2026)
|
|
29
48
|
|
|
30
49
|
### 🔧 Audit Completo — 45 Agentes
|
|
@@ -78,7 +97,7 @@ Meu ecossistema opera como um Cérebro de Conversão Privado na borda. Quando um
|
|
|
78
97
|
- **`GET /api/fraud/blocklist`** — IPs/fingerprints atualmente bloqueados
|
|
79
98
|
- **`POST /api/fraud/blocklist/add`** — Bloquear IP ou fingerprint (via KV, efeito imediato)
|
|
80
99
|
- **`DELETE /api/fraud/blocklist/remove`** — Remover do blocklist
|
|
81
|
-
- Sinais detectados: bot_score, datacenter IP, velocity attack,
|
|
100
|
+
- Sinais detectados: bot_score, datacenter IP, velocity attack, headless UA, sem Accept-Language
|
|
82
101
|
- Schema D1: `fraud_signals`, `fraud_alerts` + VIEW `v_fraud_dashboard`
|
|
83
102
|
- Agente: `fraud-detection-agent.md`
|
|
84
103
|
|
|
@@ -98,7 +117,7 @@ graph TD
|
|
|
98
117
|
FraudGate -->|score ≥ 80: Silent Drop 200| Void[/dev/null]
|
|
99
118
|
FraudGate -->|score < 80: Permitido| Worker[Cloudflare Worker Agent]
|
|
100
119
|
Worker -->|Identity Graph + _cdp_uid| D1[(D1 SQL — 21 tabelas)]
|
|
101
|
-
Worker -->|LTV + A/B Prompt| AI[Workers AI
|
|
120
|
+
Worker -->|LTV + A/B Prompt| AI[Workers AI Granite 4.0 Micro]
|
|
102
121
|
Worker -->|Segmento ML| Cluster[ML Clustering Engine]
|
|
103
122
|
Cluster -->|Bid otimizado| Bidding[Bidding Recommendations]
|
|
104
123
|
Worker -->|Background| Queue[Cloudflare Queues]
|
|
@@ -138,7 +157,7 @@ O sistema é composto por **43+ agentes** coordenados pelo **Master Orchestrator
|
|
|
138
157
|
### 🤖 Enterprise Intelligence (Fase 1–4)
|
|
139
158
|
| Agente | Endpoint Principal | Impacto |
|
|
140
159
|
|---|---|---|
|
|
141
|
-
| **ML Clustering Agent** | `POST /api/segmentation/cluster` |
|
|
160
|
+
| **ML Clustering Agent** | `POST /api/segmentation/cluster` | K-means vetorial real (bge-m3 embeddings + Granite naming) |
|
|
142
161
|
| **Bidding Agent** | `POST /api/bidding/recommend` | -20% CPA via bid por segmento de LTV |
|
|
143
162
|
| **A/B LTV Agent** | `POST /api/ltv/ab-test/create` | +25% precisão LTV via test de prompts |
|
|
144
163
|
| **Fraud Detection Agent** | Auto em `/track` | Bloqueia click fraud, bots, velocity attacks |
|
|
@@ -187,7 +206,7 @@ POST /track (evento Lead)
|
|
|
187
206
|
├─ [2] 🔮 A/B LTV Testing — sorteia variação ativa (KV cache ~0ms)
|
|
188
207
|
│ └─ passa customSystemPrompt para predictLtv()
|
|
189
208
|
│
|
|
190
|
-
├─ [3] 🧮 LTV Prediction — Workers AI
|
|
209
|
+
├─ [3] 🧮 LTV Prediction — Workers AI Granite 4.0 Micro
|
|
191
210
|
│ └─ Score 0-100 → class High/Medium/Low → valor em BRL
|
|
192
211
|
│
|
|
193
212
|
├─ [4] 💾 D1 Writes (background via ctx.waitUntil)
|
|
@@ -286,8 +305,6 @@ wrangler deploy
|
|
|
286
305
|
|---|---|---|
|
|
287
306
|
| `/track` | POST | Evento principal (browser → CAPI) |
|
|
288
307
|
| `/health` | GET | Smoke test completo |
|
|
289
|
-
| `/webhook/hotmart` | POST | Webhook Hotmart Purchase |
|
|
290
|
-
| `/webhook/kiwify` | POST | Webhook Kiwify Purchase |
|
|
291
308
|
| `/webhook/ticto` | POST | Webhook Ticto Purchase |
|
|
292
309
|
|
|
293
310
|
### Intelligence ML
|
|
@@ -467,9 +467,10 @@ await env.AUDIT_LOGS.put(logKey, JSON.stringify({
|
|
|
467
467
|
|
|
468
468
|
### Modelo em Uso
|
|
469
469
|
```
|
|
470
|
-
@cf/
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
@cf/ibm-granite/granite-4.0-h-micro ← LTV Prediction + Naming de Clusters
|
|
471
|
+
@cf/baai/bge-m3 ← Embeddings para K-means vetorial (ML Clustering)
|
|
472
|
+
Custo Granite: ~20-35 neurônios/requisição (3x mais eficiente que Llama 3.1 8B)
|
|
473
|
+
Limite Free: 10.000 neurônios/dia (~350 predições/dia com Granite)
|
|
473
474
|
```
|
|
474
475
|
|
|
475
476
|
### Uso no Worker (LTV Prediction)
|
|
@@ -485,7 +486,7 @@ async function predictLtv(leadData, env) {
|
|
|
485
486
|
Responda apenas: {"class": "high|medium|low", "value": 0-1000}
|
|
486
487
|
`;
|
|
487
488
|
|
|
488
|
-
const response = await env.AI.run('@cf/
|
|
489
|
+
const response = await env.AI.run('@cf/ibm-granite/granite-4.0-h-micro', {
|
|
489
490
|
messages: [{ role: 'user', content: prompt }],
|
|
490
491
|
max_tokens: 50
|
|
491
492
|
});
|
|
@@ -71,7 +71,6 @@ checkFraudGate(env, request, payload)
|
|
|
71
71
|
| IP de datacenter | ASN = AWS, GCP, Azure, DigitalOcean, Linode | +35 pts |
|
|
72
72
|
| Sem headers de browser | Accept-Language ausente | +20 pts |
|
|
73
73
|
| Geo impossível | IP country ≠ país esperado (BR fora da LATAM) | +10 pts |
|
|
74
|
-
| Email temporário | @mailinator, @guerrilla, @tempmail, etc. | +25 pts |
|
|
75
74
|
|
|
76
75
|
### 4. Threshold de Ação
|
|
77
76
|
```
|
|
@@ -43,7 +43,7 @@ import { predictLtv } from './ltv-predictor.js';
|
|
|
43
43
|
* @param {Request} request - request original
|
|
44
44
|
*/
|
|
45
45
|
async function dispatchLinkedIn(env, leadData, request) {
|
|
46
|
-
// 1. Obter LTV predito pelo ML (Workers AI —
|
|
46
|
+
// 1. Obter LTV predito pelo ML (Workers AI — Granite 4.0 Micro)
|
|
47
47
|
let conversionValue = 0;
|
|
48
48
|
try {
|
|
49
49
|
const ltvResult = await predictLtv(env, leadData, request);
|
|
@@ -14,7 +14,7 @@ Sua única responsabilidade é instruir o Cloudflare Architect a imbuir modelos
|
|
|
14
14
|
|
|
15
15
|
## 📦 O PACOTE DE ENTREGA OBRIGATÓRIO
|
|
16
16
|
Sempre que o Orquestrador invocar a Otimização de Baleias (LTV Prediction):
|
|
17
|
-
1. **Snippet de Injeção de ML**: Entregue ao Server Architect o bloco `await env.AI.run('@cf/
|
|
17
|
+
1. **Snippet de Injeção de ML**: Entregue ao Server Architect o bloco `await env.AI.run('@cf/ibm-granite/granite-4.0-h-micro', ...)` ajustado para predição puramente matemática.
|
|
18
18
|
2. **Override de Event Valuation**: Modifique como o evento `Lead` ou `Purchase` é envernizado com lucro preditivo antes do dispatch da CAPI.
|
|
19
19
|
|
|
20
20
|
> 👁️ "Não pague por cliques hoje. Compre os clientes de amanhã. Faça o algoritmo apostar sempre nas suas fichas vencedoras."
|
|
@@ -27,7 +27,7 @@ Sempre que o Orquestrador invocar a Otimização de Baleias (LTV Prediction):
|
|
|
27
27
|
- Dados de UTM: `utm_source`, `utm_medium`, `utm_campaign`
|
|
28
28
|
- `request.cf.asOrganization` e `request.cf.country` (sinais de qualidade do tráfego)
|
|
29
29
|
- Histórico D1 do `_cdp_uid`: páginas visitadas, tempo na página, eventos anteriores
|
|
30
|
-
- Binding `env.AI` (Cloudflare Workers AI — `@cf/
|
|
30
|
+
- Binding `env.AI` (Cloudflare Workers AI — `@cf/ibm-granite/granite-4.0-h-micro`)
|
|
31
31
|
|
|
32
32
|
## RESPONSABILIDADE
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ Sempre que o Orquestrador invocar a Otimização de Baleias (LTV Prediction):
|
|
|
35
35
|
- Classificar o lead em `predicted_ltv_class: 'High' | 'Medium' | 'Low'`
|
|
36
36
|
- Substituir `value: 0` do evento `Lead` pelo valor preditivo antes do dispatch CAPI/GA4/TikTok
|
|
37
37
|
- Registrar no D1 `identity_graph`: `predicted_ltv`, `predicted_ltv_class`
|
|
38
|
-
- Consumo
|
|
38
|
+
- Consumo: ~20–35 neurônios/request com Granite 4.0 Micro (~350 predições/dia no free tier, ilimitado no paid)
|
|
39
39
|
|
|
40
40
|
## SAÍDA
|
|
41
41
|
|
|
@@ -44,7 +44,7 @@ Sempre que o Orquestrador invocar a Otimização de Baleias (LTV Prediction):
|
|
|
44
44
|
"arquivos_criados": [
|
|
45
45
|
"cloudflare/ltv-predictor.js"
|
|
46
46
|
],
|
|
47
|
-
"modelo_ai": "@cf/
|
|
47
|
+
"modelo_ai": "@cf/ibm-granite/granite-4.0-h-micro",
|
|
48
48
|
"campo_substituido": "value",
|
|
49
49
|
"exemplo": {
|
|
50
50
|
"evento": "Lead",
|
|
@@ -128,74 +128,74 @@ is_business_hours = 1 if 9 <= hour_of_day <= 18 else 0
|
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
|
131
|
-
## Fase 2 — K-Means
|
|
131
|
+
## Fase 2 — K-Means Vetorial Real (embeddinggemma-300m + K-means em JS)
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
> **Arquitetura atual:** O clustering não usa LLM para fazer os cálculos matemáticos.
|
|
134
|
+
> Em vez disso, usa **embeddings semânticos reais** + **K-means implementado em JavaScript**,
|
|
135
|
+
> com o Granite usado **apenas para nomear** os clusters resultantes.
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
# Enviar para: env.AI.run('@cf/meta/llama-3.1-8b-instruct', ...)
|
|
137
|
+
### 2.1 Pipeline de Clustering
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
```
|
|
140
|
+
100 leads (sample) → perfil textual → embeddinggemma-300m → vetores 768d
|
|
141
|
+
↓
|
|
142
|
+
K-means++ (cosine distance, JS puro)
|
|
143
|
+
↓
|
|
144
|
+
silhouette score real calculado em JS
|
|
145
|
+
↓
|
|
146
|
+
Granite 4.0 Micro nomeia cada cluster (1 call de LLM)
|
|
147
|
+
```
|
|
140
148
|
|
|
141
|
-
|
|
142
|
-
Your task: Perform K-means clustering to group customers into {n_clusters} segments.
|
|
149
|
+
### 2.2 Modelos Workers AI utilizados
|
|
143
150
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
147
|
-
|
|
151
|
+
| Modelo | ID | Uso |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| **Granite 4.0 Micro** | `@cf/ibm-granite/granite-4.0-h-micro` | LTV Prediction + Naming de clusters |
|
|
154
|
+
| **EmbeddingGemma 300M** | `@cf/baai/bge-m3` | Embeddings semânticos para K-means |
|
|
148
155
|
|
|
149
|
-
|
|
150
|
-
1. Normalize all features to 0-1 range (min-max normalization)
|
|
151
|
-
2. Initialize K-means centroids randomly
|
|
152
|
-
3. Assign each lead to nearest centroid (Euclidean distance)
|
|
153
|
-
4. Recalculate centroids as mean of assigned points
|
|
154
|
-
5. Iterate until convergence (max 100 iterations)
|
|
155
|
-
6. Calculate Silhouette Score for each cluster (cohesion vs separation)
|
|
156
|
+
### 2.3 Perfil textual por lead (input para embedding)
|
|
156
157
|
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"top_features": ["ltv", "behavior_score", "engagement_score"]
|
|
173
|
-
}},
|
|
174
|
-
"centroid": {{
|
|
175
|
-
"ltv": 0.75,
|
|
176
|
-
"behavior_score": 0.80,
|
|
177
|
-
"engagement_score": 0.85
|
|
178
|
-
}},
|
|
179
|
-
"sample_leads": [lead_id_1, lead_id_2, lead_id_3]
|
|
180
|
-
}},
|
|
181
|
-
...
|
|
182
|
-
],
|
|
183
|
-
"silhouette_scores": {{
|
|
184
|
-
"overall": 0.62,
|
|
185
|
-
"by_cluster": [0.71, 0.58, 0.65, ...]
|
|
186
|
-
}},
|
|
187
|
-
"convergence": {{
|
|
188
|
-
"iterations": 47,
|
|
189
|
-
"final_inertia": 1523.45
|
|
190
|
-
}}
|
|
191
|
-
}}
|
|
158
|
+
```javascript
|
|
159
|
+
function _buildLeadProfile(l) {
|
|
160
|
+
return [
|
|
161
|
+
`LTV: ${l.predicted_ltv_class || 'desconhecido'}`,
|
|
162
|
+
`engajamento: ${Math.round(l.engagement_score || 0)}`,
|
|
163
|
+
`intenção: ${l.intention_level || 'desconhecida'}`,
|
|
164
|
+
`origem: ${l.utm_source || 'direto'}`,
|
|
165
|
+
`canal: ${l.utm_medium || 'desconhecido'}`,
|
|
166
|
+
`país: ${l.country || 'BR'}`,
|
|
167
|
+
`hora: ${l.hour_of_day || 12}h`,
|
|
168
|
+
(l.is_weekend ? 'fim-de-semana' : 'dia-útil'),
|
|
169
|
+
`recência: ${l.days_since_lead || 0} dias`,
|
|
170
|
+
].filter(Boolean).join(', ');
|
|
171
|
+
}
|
|
172
|
+
```
|
|
192
173
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
174
|
+
### 2.4 Chamada de embeddings em batch
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
177
|
+
// Embeds até 100 perfis em uma única chamada
|
|
178
|
+
const embRes = await env.AI.run('@cf/baai/bge-m3', { text: profiles });
|
|
179
|
+
const vectors = embRes.data; // float32[][] — shape [N, 768]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 2.5 K-means vetorial (cosine distance)
|
|
183
|
+
|
|
184
|
+
```javascript
|
|
185
|
+
// Inicialização K-means++ → iterações até convergência → assignments finais
|
|
186
|
+
const { assignments } = _kmeansRun(vectors, nClusters); // implementado em worker.js
|
|
187
|
+
const silhouetteScore = _silhouette(vectors, assignments, nClusters); // score real
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 2.6 Naming dos clusters via Granite (único uso de LLM)
|
|
191
|
+
|
|
192
|
+
```javascript
|
|
193
|
+
// Granite recebe apenas as estatísticas agregadas por cluster
|
|
194
|
+
// Retorna nome descritivo + recomendação de campanha em português
|
|
195
|
+
const nameRes = await env.AI.run('@cf/ibm-granite/granite-4.0-h-micro', {
|
|
196
|
+
messages: [{ role: 'user', content: namingPrompt }],
|
|
197
|
+
max_tokens: 800
|
|
198
|
+
});
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
### 2.2 Features para K-Means
|
|
@@ -484,20 +484,30 @@ export async function onRequestGet(context: EventContext<Env>) {
|
|
|
484
484
|
// Feature Engineering
|
|
485
485
|
const features = extractFeatures(leads);
|
|
486
486
|
|
|
487
|
-
//
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
|
|
487
|
+
// 1. Embeddings reais via embeddinggemma-300m
|
|
488
|
+
const profiles = sample.map(_buildLeadProfile);
|
|
489
|
+
const embRes = await context.env.AI.run('@cf/baai/bge-m3', { text: profiles });
|
|
490
|
+
const vectors = embRes.data; // vetores 768d
|
|
491
|
+
|
|
492
|
+
// 2. K-means vetorial real (JS puro, cosine distance)
|
|
493
|
+
const { assignments } = _kmeansRun(vectors, nClusters);
|
|
494
|
+
const silhouetteScore = _silhouette(vectors, assignments, nClusters);
|
|
495
|
+
|
|
496
|
+
// 3. Granite apenas para nomear clusters
|
|
497
|
+
const nameRes = await context.env.AI.run('@cf/ibm-granite/granite-4.0-h-micro',
|
|
498
|
+
{ messages: [{ role: 'user', content: getNamingPrompt(clusterStats) }], max_tokens: 800 }
|
|
491
499
|
);
|
|
492
|
-
|
|
493
|
-
// Persistir no D1
|
|
500
|
+
|
|
501
|
+
// 4. Persistir no D1
|
|
494
502
|
await saveClusters(context.env.DB, clusters, algorithm);
|
|
495
|
-
|
|
503
|
+
|
|
496
504
|
return Response.json({
|
|
497
505
|
success: true,
|
|
498
506
|
algorithm,
|
|
507
|
+
engine: 'embeddinggemma-300m + kmeans vetorial',
|
|
499
508
|
n_clusters: nClusters,
|
|
500
|
-
|
|
509
|
+
silhouette_score: silhouetteScore,
|
|
510
|
+
clusters,
|
|
501
511
|
generated_at: new Date().toISOString()
|
|
502
512
|
});
|
|
503
513
|
}
|
|
@@ -658,7 +668,7 @@ interface SegmentationAPI {
|
|
|
658
668
|
|
|
659
669
|
```
|
|
660
670
|
[ ] Feature Engineering Pipeline implementada
|
|
661
|
-
[ ] K-means Clustering
|
|
671
|
+
[ ] K-means Clustering vetorial (embeddinggemma-300m + JS)
|
|
662
672
|
[ ] DBSCAN Clustering para anomalias
|
|
663
673
|
[ ] Hierarchical Clustering (drill-down)
|
|
664
674
|
[ ] Auto-Interpretação de segmentos
|
|
@@ -679,7 +689,8 @@ interface SegmentationAPI {
|
|
|
679
689
|
| `Clusters vazios` | Menos de `min_data_points` no D1 | Aumentar `max_data_age_months` ou aguardar mais dados |
|
|
680
690
|
| `Silhouette Score < 0.3` | Clusters não são separáveis | Aumentar `n_clusters` ou usar features melhores |
|
|
681
691
|
| `Outliers excessivos` | Epsilon/MinPts muito agressivos no DBSCAN | Ajustar parâmetros de detecção de anomalias |
|
|
682
|
-
| `
|
|
692
|
+
| `embeddinggemma timeout` | Batch maior que 100 perfis | Limitar sample a 100 leads (padrão atual) |
|
|
693
|
+
| `vectors insuficientes` | embeddinggemma retornou menos vetores que nClusters | Reduzir nClusters ou verificar resposta da API |
|
|
683
694
|
|
|
684
695
|
---
|
|
685
696
|
|
|
@@ -26,6 +26,9 @@ Toda a sua análise deve ser baseada na infraestrutura nativa da Cloudflare.
|
|
|
26
26
|
| Página de obrigado | `Purchase_Success` | 🔴 crítico |
|
|
27
27
|
| **Preço Formatado (R$, $, €)** | `value_extraction` (Atrelado ao CTA) | 🔴 crítico |
|
|
28
28
|
| **Campo de Formulário Oculto (CSS hide/opacity 0)** | `honeypot_field` | 🔴 crítico |
|
|
29
|
+
| **[IMÓVEIS] Mapa / botão "Ver localização" / iframe Google Maps** | `FindLocation` | 🔴 crítico imobiliário |
|
|
30
|
+
| **[IMÓVEIS] Simulador de financiamento / parcelas / FGTS / Caixa** | `CustomizeProduct` | 🔴 crítico imobiliário |
|
|
31
|
+
| **[IMÓVEIS] Botão "Favoritar" / ícone de coração / "Salvar imóvel"** | `AddToWishlist` | 🟡 essencial imobiliário |
|
|
29
32
|
| **Aparecimento de Botão Atrasado (Timer)** | `pitch_seen` | 🟡 essencial |
|
|
30
33
|
| **Classe de Erro CSS (.error, .invalid)** | `form_error_detected` | 🟡 essencial |
|
|
31
34
|
| **Micro-Evento: Rage Click** | `rage_click` | 🟡 essencial |
|
|
@@ -39,8 +42,9 @@ Toda a sua análise deve ser baseada na infraestrutura nativa da Cloudflare.
|
|
|
39
42
|
Antes de mapear elementos, identifique o **modelo de negócio** da página para ativar protocolos específicos:
|
|
40
43
|
|
|
41
44
|
1. **Lançamento Imobiliário**:
|
|
42
|
-
* Sinais: Galeria de fotos de imóveis, botões WhatsApp, formulário curto, mapas
|
|
43
|
-
* Protocolo: Ativar `geolocation`
|
|
45
|
+
* Sinais: Galeria de fotos de imóveis, botões WhatsApp, formulário curto, mapas, simulador de financiamento, botão favoritar, calendário de agendamento, tour 360°.
|
|
46
|
+
* Protocolo: Ativar `geolocation`, `lead_lock_whatsapp`, `real_estate_events`.
|
|
47
|
+
* Eventos obrigatórios extras: `FindLocation` (mapa/localização), `CustomizeProduct` (simulação financiamento), `AddToWishlist` (favoritar), `Schedule` (agendamento de visita), `Contact` (WhatsApp/telefone), `video_25/50/75/complete` (tour virtual/VSL).
|
|
44
48
|
2. **Página de Vendas (Infoproduto)**:
|
|
45
49
|
* Sinais: Botões Hotmart/Kiwify/Ticto, Vídeo (VSL), Depoimentos, Preço.
|
|
46
50
|
* Protocolo: Ativar `checkout_passthrough` e `vsl_retention`.
|