hubspot-revops-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Build revenue analytics infrastructure on HubSpot API + SQL data warehouse. Covers ICP validation, ML lead scoring, competitive intelligence, activity analysis, and pipeline forecasting — bridging CRM data into actionable intelligence products.
</objective>
<quick_start>
- Create a HubSpot Private App with required CRM scopes (contacts, companies, deals, owners, timeline)
- Confirm SQL replica access and schema prefix for your data warehouse
- Run ICP validation query (UC1) to segment conversion rates
- Build pipeline forecast (UC5) using stage-specific historical win rates </quick_start>
<success_criteria>
- HubSpot Private App authenticated with all required scopes
- SQL warehouse connected and data freshness validated (sync lag < 24h)
- At least one use case (ICP, scoring, competitive, activity, forecast) producing results
- Lead scoring model trained on 200+ historical closed deals with measurable AUC
- Enrichment pipeline writing scores back to HubSpot without duplicates </success_criteria>
<objective>
基于HubSpot API + SQL数据仓库构建收入分析基础设施。涵盖ICP验证、ML线索评分、竞争情报、活动分析以及销售管道预测——将CRM数据转化为可落地的智能产品。
</objective>
<quick_start>
- 创建具备所需CRM权限范围(联系人、公司、交易、负责人、时间线)的HubSpot私有应用
- 确认数据仓库的SQL副本访问权限和架构前缀
- 运行ICP验证查询(UC1)以细分转化率
- 利用各阶段历史赢单率构建销售管道预测(UC5) </quick_start>
<success_criteria>
- HubSpot私有应用已通过所有必要权限范围的认证
- SQL数据仓库已连接,且数据新鲜度已验证(同步延迟<24小时)
- 至少一个用例(ICP、评分、竞争情报、活动分析、预测)已产出结果
- 线索评分模型基于200+历史已结交易训练,且具备可衡量的AUC值
- Enrichment管道可将评分写回HubSpot,且无重复数据 </success_criteria>
HubSpot RevOps Analytics
HubSpot RevOps收入分析
Revenue analytics infrastructure on HubSpot API + SQL data warehouse.
Bridges CRM data → analytics → intelligence products → revenue impact.
Scope: HubSpot-specific analytics stack. For basic CRM CRUD, use . For generic dashboards, use .
crm-integration-skilldata-analysis-skill基于HubSpot API + SQL数据仓库的收入分析基础设施。打通CRM数据→分析→智能产品→收入影响的全链路。
适用范围: HubSpot专属分析栈。如需基础CRM增删改查操作,请使用。如需通用仪表板,请使用。
crm-integration-skilldata-analysis-skillSetup Checklist
配置检查清单
1. HubSpot Private App
1. HubSpot私有应用
Create at Settings → Integrations → Private Apps:
| Scope | Permission | Why |
|---|---|---|
| Read/Write | Contact enrichment |
| Read | Company data |
| Read/Write | Pipeline analytics |
| Read | Custom objects |
| Read | Rep attribution |
| Read | Activity data |
在设置→集成→私有应用中创建:
| 权限范围 | 权限 | 原因 |
|---|---|---|
| 读/写 | 联系人Enrichment |
| 读 | 公司数据获取 |
| 读/写 | 销售管道分析 |
| 读 | 自定义对象访问 |
| 读 | 销售代表归因 |
| 读 | 活动数据获取 |
2. SQL Replica Access
2. SQL副本访问
Discovery questions for your data warehouse:
| Question | Options |
|---|---|
| Where is HubSpot data replicated? | Snowflake / BigQuery / Postgres / Redshift |
| What ETL tool syncs it? | Fivetran / Airbyte / Stitch / HubSpot Data Sync |
| Sync frequency? | Real-time / Hourly / Daily |
| Schema prefix? | |
针对数据仓库的调研问题:
| 问题 | 选项 |
|---|---|
| HubSpot数据复制到哪里? | Snowflake / BigQuery / Postgres / Redshift |
| 使用什么ETL工具同步? | Fivetran / Airbyte / Stitch / HubSpot Data Sync |
| 同步频率? | 实时 / 每小时 / 每日 |
| 架构前缀? | |
3. Python Environment
3. Python环境
bash
pip install hubspot-api-client pandas scikit-learn requestspython
undefinedbash
pip install hubspot-api-client pandas scikit-learn requestspython
undefinedSDK initialization
SDK初始化
from hubspot import HubSpot
client = HubSpot(access_token="pat-na1-xxxxx")
from hubspot import HubSpot
client = HubSpot(access_token="pat-na1-xxxxx")
Or raw requests
或原生请求
import requests
HEADERS = {"Authorization": "Bearer pat-na1-xxxxx", "Content-Type": "application/json"}
BASE = "https://api.hubapi.com"
---import requests
HEADERS = {"Authorization": "Bearer pat-na1-xxxxx", "Content-Type": "application/json"}
BASE = "https://api.hubapi.com"
---Core Use Cases
核心用例
| # | Use Case | Input | Output | Tools |
|---|---|---|---|---|
| 1 | ICP Validation | Contact + company data | Segment conversion rates | SQL + Clay |
| 2 | Lead Scoring | Historical deals | Win probability per lead | SQL + ML + API |
| 3 | Competitive Intel | Deal close reasons | Win/loss by competitor | SQL + webhook |
| 4 | Activity Analysis | Engagement data | Activity→outcome correlation | SQL |
| 5 | Pipeline Forecast | Open deals + stage history | Weighted revenue forecast | SQL |
| # | 用例 | 输入 | 输出 | 工具 |
|---|---|---|---|---|
| 1 | ICP验证 | 联系人+公司数据 | 细分转化率 | SQL + Clay |
| 2 | 线索评分 | 历史交易数据 | 每条线索的赢单概率 | SQL + ML + API |
| 3 | 竞争情报 | 交易关闭原因 | 按竞争对手统计赢/输单情况 | SQL + webhook |
| 4 | 活动分析 | 互动数据 | 活动与结果的相关性 | SQL |
| 5 | 销售管道预测 | 未结交易+阶段历史数据 | 加权收入预测 | SQL |
Use Case Details
用例详情
UC1 — ICP Validation: Join contacts + companies + deals in SQL, segment by industry/size/geo, compute conversion rates per segment. Feed results to Clay for enrichment writeback.
UC2 — Lead Scoring: Train GradientBoostingClassifier on historical won/lost deals. Features: company size, industry, engagement score, days in pipeline. Deploy scores back to HubSpot as custom property.
UC3 — Competitive Intel: Extract competitor mentions from deal . Build win/loss matrix by competitor. Trigger webhook alerts on competitive displacement patterns.
closed_lost_reasonUC4 — Activity Analysis: Correlate email opens, meetings booked, calls logged with deal outcomes. Identify which activities actually move deals forward.
UC5 — Pipeline Forecast: Calculate weighted forecast using stage-specific win rates from historical data. Factor in deal age, velocity, and rep performance.
Reference: Seefor complete SQL templates per use case.reference/sql-analytics.md
UC1 — ICP验证: 在SQL中关联联系人+公司+交易数据,按行业/规模/地域细分,计算各细分群体的转化率。将结果导入Clay以完成Enrichment并写回HubSpot。
UC2 — 线索评分: 基于历史赢单/输单交易训练GradientBoostingClassifier模型。特征包括:公司规模、行业、互动评分、销售管道停留天数。将评分作为自定义属性通过API部署到HubSpot。
UC3 — 竞争情报: 从交易的字段提取竞争对手提及信息。构建按竞争对手划分的赢/输单矩阵。针对竞争对手替代模式设置webhook告警。
closed_lost_reasonUC4 — 活动分析: 将邮件打开、会议预约、通话记录等互动数据与交易结果关联,识别真正能推动交易进展的活动类型。
UC5 — 销售管道预测: 利用各阶段历史赢单率计算加权预测值。同时考虑交易时长、推进速度和销售代表绩效。
参考: 各用例完整SQL模板请查看。reference/sql-analytics.md
Quick Reference: HubSpot API Endpoints
快速参考:HubSpot API端点
| Object | Endpoint | Key Operations |
|---|---|---|
| Contacts | | Search, create, update, batch |
| Companies | | Search, associate to contacts |
| Deals | | Pipeline, stage history |
| Engagements | | Emails, calls, meetings |
| Properties | | Custom property CRUD |
| Associations | | Object linking |
| Search | | Filter + sort (max 10k) |
Reference: Seefor auth, SDK patterns, batch operations.reference/api-guide.md
| 对象 | 端点 | 核心操作 |
|---|---|---|
| Contacts | | 搜索、创建、更新、批量操作 |
| Companies | | 搜索、与联系人关联 |
| Deals | | 销售管道、阶段历史 |
| Engagements | | 邮件、通话、会议 |
| Properties | | 自定义属性增删改查 |
| Associations | | 对象关联 |
| Search | | 筛选+排序(最多10k条结果) |
参考: 认证、SDK模式、批量操作详情请查看。reference/api-guide.md
Quick Reference: SQL Object Model
快速参考:SQL对象模型
| HubSpot Object | SQL Table (typical) | Key Columns | Join Key |
|---|---|---|---|
| Contacts | | email, lifecycle_stage, lead_score | contact_id |
| Companies | | domain, industry, employee_count | company_id |
| Deals | | amount, stage, close_date, pipeline | deal_id |
| Deal Stages | | stage, timestamp, duration | deal_id |
| Engagements | | type, created_at, contact_id | engagement_id |
| Owners | | email, first_name, team | owner_id |
Join pattern: contacts → associations → companies/deals (via association tables)
| HubSpot对象 | 典型SQL表 | 核心字段 | 关联键 |
|---|---|---|---|
| Contacts | | email, lifecycle_stage, lead_score | contact_id |
| Companies | | domain, industry, employee_count | company_id |
| Deals | | amount, stage, close_date, pipeline | deal_id |
| Deal Stages | | stage, timestamp, duration | deal_id |
| Engagements | | type, created_at, contact_id | engagement_id |
| Owners | | email, first_name, team | owner_id |
关联模式: contacts → associations → companies/deals(通过关联表)
Integration Points
集成点
| Skill | Relationship |
|---|---|
| Base CRUD patterns, auth setup |
| Visualization, Streamlit dashboards |
| Pipeline metrics, MEDDIC context, forecasting |
| Market/competitive research methodology |
| Track API calls + Clay enrichment spend |
| Skill | 关系 |
|---|---|
| 基础增删改查模式、认证设置 |
| 可视化、Streamlit仪表板 |
| 销售管道指标、MEDDIC框架、预测 |
| 市场/竞争研究方法论 |
| 追踪API调用+Clay Enrichment成本 |
Common Mistakes
常见错误
| Mistake | Fix |
|---|---|
| Exceeding 100 requests/10s rate limit | Use batch endpoints, add exponential backoff |
| Using Search API for >10k results | Switch to SQL warehouse for bulk analytics |
| Hardcoded property internal names | Fetch property definitions first: |
| Missing association API for object links | Use v4 associations: |
SQL | Use |
Not handling HubSpot's | Always include |
| Clay enrichment without dedup | Check existing property values before writeback |
| Scoring model trained on small dataset | Need 200+ closed deals minimum for reliable ML scores |
| 错误 | 修复方案 |
|---|---|
| 超过100请求/10秒的速率限制 | 使用批量端点,添加指数退避机制 |
| 对>10k条结果使用Search API | 切换到SQL数据仓库进行批量分析 |
| 硬编码属性内部名称 | 先获取属性定义: |
| 对象关联时缺少Association API | 使用v4关联接口: |
Postgres中使用SQL | 使用 |
未处理HubSpot的 | 在属性请求中始终包含 |
| Clay Enrichment未去重 | 写回前检查现有属性值 |
| 评分模型基于小数据集训练 | 至少需要200+已结交易才能获得可靠的ML评分 |
Workflow Phases
工作流阶段
Phase 1: Foundation
阶段1:基础搭建
- Set up Private App with required scopes
- Confirm SQL replica access and schema
- Run schema discovery queries
- Validate data freshness (sync lag)
- 设置具备所需权限范围的私有应用
- 确认SQL副本访问权限和架构
- 运行架构发现查询
- 验证数据新鲜度(同步延迟)
Phase 2: Analytics
阶段2:分析构建
- Build ICP validation queries (UC1)
- Create pipeline velocity dashboard (UC2, UC5)
- Set up competitive intelligence tracking (UC3)
- 构建ICP验证查询(UC1)
- 创建销售管道速度仪表板(UC2、UC5)
- 设置竞争情报追踪(UC3)
Phase 3: Intelligence
阶段3:智能落地
- Train lead scoring model on historical deals
- Deploy scores to HubSpot via API
- Build enrichment pipelines (Clay → HubSpot)
- Set up automated alerts and webhooks
Reference: Seefor ML scoring and Clay integration. Reference: Seereference/enrichment-pipelines.mdfor deployment patterns and cost estimates.reference/architecture.md
- 基于历史交易训练线索评分模型
- 通过API将评分部署到HubSpot
- 构建Enrichment管道(Clay → HubSpot)
- 设置自动化告警和webhook
参考: ML评分和Clay集成详情请查看。 参考: 部署模式和成本估算请查看reference/enrichment-pipelines.md。reference/architecture.md