跨40多个平台查询和管理营销数据——Google Analytics、Google Ads、Facebook Ads、Instagram、Shopify、HubSpot、Klaviyo、TikTok、LinkedIn等。
如果不存在, 则安装 InsightfulPipe. npm 发布: https://www.npmjs.com/package/insightfulpipe.是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;
涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
npm install -g insightfulpipe
npm 发布页:https://www.npmjs.com/package/insightfulpipe
| 属性 | 值 |
|---|---|
| name | insightfulpipe |
| description | 跨分析平台、广告平台、社交平台、电商平台及 SEO 平台查询营销数据 |
| allowed-tools | Bash(insightfulpipe:*) |
需预先配置环境变量 INSIGHTFULPIPE_TOKEN。若命令执行失败并提示 “Invalid token” 或 “Not authenticated”,请告知用户需配置其 Token。
所有查询均遵循:发现 → 架构 → 执行。读操作(query)可直接运行;写操作(action)必须在执行前获得用户确认。
# 1. 获取账户 ID(workspace_id、brand_id、source ID 等) insightfulpipe accounts --platform--json # 2. 查看可用操作 insightfulpipe helper # 3. 获取特定操作的请求体架构(schema) insightfulpipe helper --actions , # 4. 执行读查询 insightfulpipe query -b '{"action":" ","workspace_id": ,"brand_id": ,...}' # 5. 执行写操作(需指定 --yes 参数) insightfulpipe action -b '{"action":" ",...}' --yes
insightfulpipe accounts --platform google-analytics --json
insightfulpipe helper google-analytics --actions pages
insightfulpipe query google-analytics -b '{
"action": "pages",
"workspace_id": xxx,
"brand_id": xxx,
"property_id": "properties/xxx",
"dimensions": ["pagePath"],
"metrics": ["screenPageViews", "activeUsers"],
"start_date": "2026-03-01",
"end_date": "2026-03-20",
"limit": 10
}'
insightfulpipe query google-analytics -b '{
"action": "traffic_sources",
"workspace_id": xxx,
"brand_id": xxx,
"property_id": "properties/xxx",
"dimensions": ["sessionSource", "sessionMedium"],
"metrics": ["sessions", "totalUsers", "bounceRate"],
"start_date": "2026-03-01",
"end_date": "2026-03-20"
}'
insightfulpipe query google-analytics -b '{
"action": "get_report",
"workspace_id": xxx,
"brand_id": xxx,
"property_id": "properties/xxx",
"dimensions": ["date", "country"],
"metrics": ["activeUsers", "sessions"],
"start_date": "2026-03-01",
"end_date": "2026-03-20"
}'
insightfulpipe query google-search-console -b '{
"action": "search_analytics",
"workspace_id": xxx,
"brand_id": xxx,
"site_url": "https://example.com/",
"dimensions": ["query"],
"start_date": "2026-03-01",
"end_date": "2026-03-20",
"row_limit": 10
}'
insightfulpipe query google-search-console -b '{
"action": "search_analytics",
"workspace_id": xxx,
"brand_id": xxx,
"site_url": "https://example.com/",
"dimensions": ["page", "country"],
"start_date": "2026-03-01",
"end_date": "2026-03-20",
"row_limit": 20
}'
# 首先预览以获取列名
insightfulpipe query google-sheets -b '{
"action": "get_sheet_peak",
"workspace_id": xxx,
"brand_id": xxx,
"spreadsheet_id": "xxx",
"sheet_id": "0"
}'
# 然后使用预览所得的准确列名进行带过滤条件的查询
insightfulpipe query google-sheets -b '{
"action": "query_sheet_data",
"workspace_id": xxx,
"brand_id": xxx,
"spreadsheet_id": "xxx",
"sheet_id": "0",
"select": "Name,Email,Status",
"where": "Status=Active",
"limit": 50
}'
insightfulpipe action google-sheets -b '{
"action": "update_cells",
"workspace_id": xxx,
"brand_id": xxx,
"spreadsheet_id": "xxx",
"sheet_id": "0",
"range": "A1:C2",
"values": [["Name", "Email", "Status"], ["John", "john@example.com", "Active"]]
}' --yes
insightfulpipe query shopify -b '{
"action": "get_orders",
"workspace_id": xxx,
"brand_id": xxx,
"status": "any",
"limit": 10
}'
insightfulpipe query shopify -b '{
"action": "get_products",
"workspace_id": xxx,
"brand_id": xxx,
"limit": 10
}'
# 所有平台均适用相同模式: insightfulpipe helper# 查看支持的操作 insightfulpipe helper --actions # 获取请求体架构 insightfulpipe query -b '{...}' # 执行查询
已支持平台包括:facebook-ads、instagram、tiktok-ads、tiktok-pages、linkedin-ads、linkedin-pages、hubspot、klaviyo、mailchimp、stripe、slack、telegram,以及更多。运行 insightfulpipe platforms 可查看完整列表。
# 从 GA 响应中仅提取 pagePath 字段
insightfulpipe query google-analytics -b '{...}' | jq '.data[].pagePath'
# 统计总会话数
insightfulpipe query google-analytics -b '{...}' | jq '[.data[].sessions] | add'
# GA 流量数据
GA=$(insightfulpipe query google-analytics -b '{
"action": "traffic_sources", "workspace_id": xxx, "brand_id": xxx,
"property_id": "properties/xxx",
"dimensions": ["sessionSource"], "metrics": ["sessions"],
"start_date": "2026-03-01", "end_date": "2026-03-20"
}')
# GSC 搜索词数据
GSC=$(insightfulpipe query google-search-console -b '{
"action": "search_analytics", "workspace_id": xxx, "brand_id": xxx,
"site_url": "https://example.com/",
"dimensions": ["query"],
"start_date": "2026-03-01", "end_date": "2026-03-20", "row_limit": 10
}')
echo "$GA" | jq '.data[:5]'
echo "$GSC" | jq '.data[:5]'
# 写操作始终使用 "action"(而非 "query"),且必须添加 --yes 参数
insightfulpipe action google-sheets -b '{
"action": "create_sheet",
"workspace_id": xxx,
"brand_id": xxx,
"spreadsheet_id": "xxx",
"title": "New Sheet"
}' --yes
insightfulpipe prompts google-analytics # 列出模板 insightfulpipe prompts google-analytics --id 12 # 获取指定 ID 的 Prompt
helper --actions 获取准确结构。accounts --platform --json 获取真实 ID 值。"properties/510157516",而非 "510157516"。"2026-03-20",不可使用 "2026-03-20T00:00:00Z"。query,写操作用 action --yes — 混用将导致失败。get_sheet_peak 获取列名。property_id,Google Search Console 使用 site_url,Shopify 使用 shop_domain,Facebook Ads 使用 ad_account_id。{"status":"success","data":[]} 表示筛选条件未匹配到任何数据。insightfulpipe action 前必须向用户确认;而通过 insightfulpipe query 执行的读操作可安全直行。# 发现(Discovery) insightfulpipe platforms # 查看所有支持的平台 insightfulpipe accounts --platform--json # 获取账户 ID insightfulpipe sources --platform # 获取含 ID 的数据源列表 insightfulpipe brands --workspace # 获取品牌元数据 insightfulpipe whoami # 查看当前用户 insightfulpipe doctor # 检查认证状态 # 架构(Schema) insightfulpipe helper # 列出该平台支持的操作 insightfulpipe helper --actions , # 获取指定操作的请求体架构 # 执行(Execute) insightfulpipe query -b ' ' # 查询(读)数据 insightfulpipe query -f file.json # 从 JSON 文件读取请求体并查询 insightfulpipe action -b ' ' --yes # 执行(写)操作 # Prompt insightfulpipe prompts # 列出该平台可用的 Prompt 模板 insightfulpipe prompts --id # 获取指定 ID 的 Prompt