Insightful Pipe

Polar Sponsor
爱发电 赞助
.NET 9.0

跨40多个平台查询和管理营销数据——Google Analytics、Google Ads、Facebook Ads、Instagram、Shopify、HubSpot、Klaviyo、TikTok、LinkedIn等。

如果不存在, 则安装 InsightfulPipe. npm 发布: https://www.npmjs.com/package/insightfulpipe.

功能概述

如果不存在, 则安装 InsightfulPipe. npm 发布: https://www.npmjs.com/package/insightfulpipe.是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。

核心要点

  • 使用时应结合输入条件选择合适的执行方式,核对必要参数、依赖环境与输出内容,并按原始要求处理异常情况。
  • 该技能适合需要稳定复用相关能力的场景,可作为自动化工作流的一部分,也便于后续检查、调整和扩展。
  • 从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。

使用与执行

实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;

结果检查与注意事项

涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。

如尚未安装 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

平台使用示例

Google Analytics — 访问量最高的页面

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
}'

Google Analytics — 流量来源

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"
}'

Google Analytics — 自由格式报表

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"
}'

Google Search Console — 排名靠前的搜索词

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
}'

Google Search Console — 按国家/地区划分的网页

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
}'

Google Sheets — 先预览列名再查询

# 首先预览以获取列名
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
}'

Google Sheets — 写入单元格

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

Shopify — 最近订单

insightfulpipe query shopify -b '{
  "action": "get_orders",
  "workspace_id": xxx,
  "brand_id": xxx,
  "status": "any",
  "limit": 10
}'

Shopify — 商品列表

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 可查看完整列表。

常见使用模式

模式 1:管道输出至 jq

# 从 GA 响应中仅提取 pagePath 字段
insightfulpipe query google-analytics -b '{...}' | jq '.data[].pagePath'

# 统计总会话数
insightfulpipe query google-analytics -b '{...}' | jq '[.data[].sessions] | add'

模式 2:跨平台数据对比

# 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]'

模式 3:写操作

# 写操作始终使用 "action"(而非 "query"),且必须添加 --yes 参数
insightfulpipe action google-sheets -b '{
  "action": "create_sheet",
  "workspace_id": xxx,
  "brand_id": xxx,
  "spreadsheet_id": "xxx",
  "title": "New Sheet"
}' --yes

模式 4:使用 Prompt 实现引导式分析

insightfulpipe prompts google-analytics            # 列出模板
insightfulpipe prompts google-analytics --id 12    # 获取指定 ID 的 Prompt

注意事项

  1. 切勿猜测请求体内容 — 务必首先运行 helper --actions 获取准确结构。
  2. 替换全部占位符 "xxx" — 使用 accounts --platform --json 获取真实 ID 值。
  3. GA 的 property_id 必须包含 "properties/" 前缀 — 应使用 "properties/510157516",而非 "510157516"。
  4. 日期格式为 YYYY-MM-DD — 应使用 "2026-03-20",不可使用 "2026-03-20T00:00:00Z"。
  5. 读操作用 query,写操作用 action --yes — 混用将导致失败。
  6. Google Sheets:查询前务必先预览 — 需先调用 get_sheet_peak 获取列名。
  7. 不同平台的资源标识符各不相同 — Google Analytics 使用 property_id,Google Search Console 使用 site_url,Shopify 使用 shop_domain,Facebook Ads 使用 ad_account_id。
  8. 空数据返回不表示错误 — {"status":"success","data":[]} 表示筛选条件未匹配到任何数据。
  9. Token 需预先配置 — 若认证失败,请提醒用户检查 Token 配置。
  10. 写操作必须经用户确认 — 运行 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

相关专题

更多
python升级pip
python升级pip

本专题整合了python升级pip相关教程,阅读下面的文章了解更多详细内容。

2025.07.23

2487

16

pip设置清华源
pip设置清华源

设置方法:1、打开终端或命令提示符窗口;2、运行“touch ~/.pip/pip.conf”命令创建一个名为pip的配置文件;3、打开pip.conf文件,然后添加“[global];index-url = https://pypi.tuna.tsinghua.edu.cn/simple”内容,这将把pip的镜像源设置为清华大学的镜像源;4、保存并关闭文件即可。

2024.12.23

5722

11

更新pip版本
更新pip版本

更新pip版本方法有使用pip自身更新、使用操作系统自带的包管理工具、使用python包管理工具、手动安装最新版本。想了解更多相关的内容,请阅读专题下面的文章。

2024.12.20

4243

6

pip安装使用方法
pip安装使用方法

安装步骤:1、确保Python已经正确安装在您的计算机上;2、下载“get-pip.py”脚本;3、按下Win + R键,然后输入cmd并按下Enter键来打开命令行窗口;4、在命令行窗口中,使用cd命令切换到“get-pip.py”所在的目录;5、执行安装命令;6、验证安装结果即可。大家可以访问本专题下的文章,了解pip安装使用方法的更多内容。

2023.10.09

1870

5

LLVM自定义Pass怎么写
LLVM自定义Pass怎么写

本专题聚焦LLVM自定义Pass开发,整理Pass类结构、run()方法、PreservedAnalyses、CMake构建、插件注册、-load-pass-plugin加载和测试用例编写流程。

2026.09.30

0

10

LLVM RISC-V参数配置教程
LLVM RISC-V参数配置教程

本专题介绍LLVM对RISC-V基础ISA和扩展的支持方式,涵盖RV32、RV64、标准扩展、实验性扩展、厂商扩展、-menable-experimental-extensions和版本差异。

2026.09.30

0

14

LLVM IR中间表示入门指南
LLVM IR中间表示入门指南

本专题整理LLVM IR的核心概念,包括中间表示作用、模块结构、函数、基本块、SSA形式、类型系统和常见语法,帮助新手理解LLVM编译流程中的关键层。

2026.09.30

0

12

PDF转图片方法
PDF转图片方法

需要把 PDF 页面用于上传、预览、分享或图片归档时,PDF 转图片方法专题整理 JPG/PNG 格式选择、逐页导出、清晰度设置、批量下载和结果检查等流程,帮助用户稳定完成 PDF 图片化处理。

2026.09.30

0

26

PixTV AI视频生成与无限画布创作
PixTV AI视频生成与无限画布创作

PixTV专题整理AI视频与视觉内容创作相关功能使用教程,涵盖AI生图、视频生成、无限画布、多模型创作、素材管理、声音音乐及视频剪辑等功能,帮助用户快速掌握PixTV从创意到成片的完整制作方法。

2026.09.29

0

15

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
Conan 2 安装指南
Conan 2 安装指南

共0课时 | 0人学习

Python虚拟环境官方教程
Python虚拟环境官方教程

共0课时 | 0人学习

Python venv官方模块文档
Python venv官方模块文档

共0课时 | 0人学习