r/DigitalMarketing 的一篇帖子询问如何让 Claude 分析 GA 和 GSC 数据以获取 SEO 建议。答案:使用 MCP 将 Claude 连接到您的分析,然后添加 Scavio MCP 以获取实时 SERP 数据。然后,Claude 可以将您的 GSC 展示次数与当前的 SERP 排名进行交叉引用。
前置条件
- 克劳德代码或克劳德桌面
- Google Analytics 4 属性
- Google Search Console 已验证网站
- Scavio API 密钥
操作指南
步骤 1: 将 Scavio MCP 添加到 Claude
注册 Scavio MCP 服务器,以便 Claude 可以进行搜索。
# In Claude Code:
claude mcp add scavio https://mcp.scavio.dev/mcp \
--header 'x-api-key: YOUR_SCAVIO_KEY'
# Verify it loaded:
claude mcp list步骤 2: 将 GSC 数据导出为 CSV
下载您的 Search Console 性能数据以供 Claude 分析。
# From GSC UI: Performance > Export > CSV
# Or use the GSC API:
from googleapiclient.discovery import build
from google.oauth2 import service_account
creds = service_account.Credentials.from_service_account_file('sa.json',
scopes=['https://www.googleapis.com/auth/webmasters.readonly'])
service = build('searchconsole', 'v1', credentials=creds)
resp = service.searchanalytics().query(siteUrl='https://yoursite.com',
body={'startDate': '2026-04-01', 'endDate': '2026-05-01',
'dimensions': ['query'], 'rowLimit': 100}).execute()
for row in resp.get('rows', []):
print(f"{row['keys'][0]}: {row['clicks']} clicks, pos {row['position']:.1f}")步骤 3: 与实时 SERP 交叉引用 GSC 查询
对于您的热门 GSC 查询,请通过 Scavio 检查当前的 SERP 位置。
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def check_serp_position(query, domain):
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=H,
json={'platform': 'google', 'query': query}).json()
for r in data.get('organic_results', []):
if domain in r.get('link', ''):
return r['position']
return None
# Compare GSC avg position vs live SERP position
# Divergence means recent ranking changes步骤 4: 要求 Claude 生成 SEO 建议
连接两个数据源后,克劳德可以给出具体建议。
# In Claude Code with Scavio MCP active:
# 'Analyze my top 10 GSC queries from this CSV.
# For each, check the current SERP position using Scavio.
# Identify queries where I dropped positions and suggest
# content improvements based on what currently ranks above me.'Python 示例
# Workflow: GSC data -> Claude MCP -> Scavio SERP check -> recommendations
# Cost: 10 keyword checks = 10 x $0.005 = $0.05
# Compare to: Ahrefs Lite $129/mo or Semrush Pro $139.95/mo for similar insightsJavaScript 示例
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'google', query: gscKeyword})
});
const serp = await res.json();
const liveRank = serp.organic_results?.findIndex(r => r.link.includes(myDomain)) + 1;预期输出
Claude analyzes GSC performance data and cross-references with live SERP positions via Scavio MCP. Outputs specific content improvement recommendations for dropping keywords.