b2c-cip
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseB2C CIP Skill
B2C CIP 技能
Use commands to query B2C Commerce Intelligence (CIP), also known as Commerce Cloud Analytics (CCAC).
b2c cipTip: Ifis not installed globally, useb2c.npx @salesforce/b2c-cli
使用 命令查询B2C Commerce Intelligence (CIP),也称为Commerce Cloud Analytics (CCAC)。
b2c cip提示: 如果没有全局安装,请使用b2c。npx @salesforce/b2c-cli
Command Structure
命令结构
text
cip
├── tables - list metadata catalog tables
├── describe <table> - describe table columns
├── query - raw SQL execution
└── report - curated report topic
├── sales-analytics
├── sales-summary
├── ocapi-requests
├── top-selling-products
├── product-co-purchase-analysis
├── promotion-discount-analysis
├── search-query-performance
├── payment-method-performance
├── customer-registration-trends
└── top-referrerstext
cip
├── tables - 列出元数据目录表
├── describe <table> - 查看表的列信息
├── query - 执行原生SQL
└── report - 精选报表主题
├── sales-analytics
├── sales-summary
├── ocapi-requests
├── top-selling-products
├── product-co-purchase-analysis
├── promotion-discount-analysis
├── search-query-performance
├── payment-method-performance
├── customer-registration-trends
└── top-referrersRequirements
使用要求
- OAuth client credentials: ,
--client-id--client-secret - CIP tenant: (or
--tenant-id)--tenant - API client has role with tenant filter for your instance
Salesforce Commerce API
Optional:
- (or
--cip-host) to override the default hostSFCC_CIP_HOST - (or
--staging) to force staging analytics hostSFCC_CIP_STAGING
::: warning Availability
This feature is typically used with production analytics tenants (for example ).
abcd_prdStarting with release 26.1, reports and dashboards data can also be enabled for non-production instances (ODS/dev/staging and designated test realms) using the Enable Reports & Dashboards Data Tracking feature switch.
Reports & Dashboards non-production URL:
:::
https://ccac.stg.analytics.commercecloud.salesforce.com- OAuth客户端凭证:、
--client-id--client-secret - CIP租户:(或
--tenant-id)--tenant - API客户端拥有角色,且租户过滤器包含你的实例
Salesforce Commerce API
可选参数:
- (或
--cip-host)可覆盖默认主机地址SFCC_CIP_HOST - (或
--staging)强制使用预发环境分析主机SFCC_CIP_STAGING
::: warning 可用性说明
该功能通常用于生产环境分析租户(例如)。
abcd_prd从26.1版本开始,你可以通过启用报表与仪表盘数据跟踪功能开关,为非生产实例(ODS/开发/预发和指定测试域)启用报表与仪表盘数据功能。
报表与仪表盘非生产环境地址:
:::
https://ccac.stg.analytics.commercecloud.salesforce.comQuick Workflow
快速工作流
- Discover available tables () or curated reports (
b2c cip tables).b2c cip report --help - Use or report
b2c cip describe <table>to inspect structure/parameters.--describe - Use report to preview generated SQL.
--sql - Pipe SQL into when you need custom execution/output handling.
cip query
- 查找可用表()或精选报表(
b2c cip tables)b2c cip report --help - 使用或报表的
b2c cip describe <表名>参数查看结构/参数--describe - 使用报表的参数预览生成的SQL
--sql - 当你需要自定义执行/输出处理时,将SQL通过管道传递给
cip query
Metadata Discovery Examples
元数据发现示例
bash
undefinedbash
undefinedList warehouse tables
列出数仓表
b2c cip tables --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>
b2c cip tables --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>
Filter table names
过滤表名
b2c cip tables --tenant-id abcd_prd --pattern "ccdw_aggr_%" --client-id <client-id> --client-secret <client-secret>
b2c cip tables --tenant-id abcd_prd --pattern "ccdw_aggr_%" --client-id <client-id> --client-secret <client-secret>
Describe table columns
查看表的列信息
b2c cip describe ccdw_aggr_ocapi_request --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>
undefinedb2c cip describe ccdw_aggr_ocapi_request --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>
undefinedKnown Tables
已知表
For an efficient table catalog grouped by aggregate/dimension/fact families, use:
references/KNOWN_TABLES.md
For a general-purpose starter query pack with ready-to-run SQL patterns, use:
references/STARTER_QUERIES.md
The list is derived from official JDBC documentation and intended as a quick discovery aid.
如果你需要按聚合/维度/事实族分组的高效表目录,请查看:
references/KNOWN_TABLES.md
如果你需要包含可直接运行的SQL模板的通用入门查询包,请查看:
references/STARTER_QUERIES.md
该列表来源于官方JDBC文档,旨在作为快速查找的辅助工具。
Curated Report Examples
精选报表示例
bash
undefinedbash
undefinedShow report commands
查看报表命令
b2c cip report --help
b2c cip report --help
Run a report
运行报表
b2c cip report sales-analytics
--site-id Sites-RefArch-Site
--from 2025-01-01
--to 2025-01-31
--tenant-id abcd_prd
--client-id <client-id>
--client-secret <client-secret>
--site-id Sites-RefArch-Site
--from 2025-01-01
--to 2025-01-31
--tenant-id abcd_prd
--client-id <client-id>
--client-secret <client-secret>
b2c cip report sales-analytics
--site-id Sites-RefArch-Site
--from 2025-01-01
--to 2025-01-31
--tenant-id abcd_prd
--client-id <client-id>
--client-secret <client-secret>
--site-id Sites-RefArch-Site
--from 2025-01-01
--to 2025-01-31
--tenant-id abcd_prd
--client-id <client-id>
--client-secret <client-secret>
Show report parameter contract
查看报表参数说明
b2c cip report top-referrers --describe
b2c cip report top-referrers --describe
Print generated SQL and stop
输出生成的SQL并停止执行
b2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --sql
b2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --sql
Force staging analytics host
强制使用预发环境分析主机
b2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --staging --sql
undefinedb2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --staging --sql
undefinedSQL Pipeline Pattern
SQL管道模式
bash
b2c cip report sales-analytics --site-id Sites-RefArch-Site --sql \
| b2c cip query --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>bash
b2c cip report sales-analytics --site-id Sites-RefArch-Site --sql \
| b2c cip query --tenant-id abcd_prd --client-id <client-id> --client-secret <client-secret>Raw SQL Query Examples
原生SQL查询示例
bash
b2c cip query \
--tenant-id abcd_prd \
--client-id <client-id> \
--client-secret <client-secret> \
"SELECT * FROM ccdw_aggr_sales_summary LIMIT 10"You can also use:
--file ./query.sql- pipe query text from standard input (for example )
cat query.sql | b2c cip query ...
bash
b2c cip query \
--tenant-id abcd_prd \
--client-id <client-id> \
--client-secret <client-secret> \
"SELECT * FROM ccdw_aggr_sales_summary LIMIT 10"你还可以使用:
--file ./query.sql- 从标准输入管道传入查询文本(例如)
cat query.sql | b2c cip query ...
Date Placeholders
日期占位符
b2c cip query- with
<FROM>--from YYYY-MM-DD - with
<TO>--to YYYY-MM-DD - defaults to first day of current month
--from - defaults to today
--to
If you provide , the common CIP format is . The command warns when does not match that pattern but still runs with your input.
--site-idSites-{siteId}-SitesiteIdb2c cip query- 对应
<FROM>--from YYYY-MM-DD - 对应
<TO>--to YYYY-MM-DD - 默认值为当月第一天
--from - 默认值为当天
--to
如果你提供了,CIP的通用格式为。如果不符合该格式,命令会发出警告,但仍会按照你的输入运行。
--site-idSites-{siteId}-SitesiteIdOutput Formats
输出格式
Both raw query and report commands support:
- (default)
--format table --format csv--format json- (global JSON mode)
--json
原生查询和报表命令都支持以下格式:
- (默认)
--format table --format csv--format json- (全局JSON模式)
--json
Service Limits and Best Practices
服务限制与最佳实践
The underlying JDBC analytics service has strict limits. Keep requests scoped:
- avoid broad queries
SELECT * - use narrow date ranges and incremental windows
- prefer aggregate tables when possible
- use report commands for common KPI workflows
Limits can change over time. Use the official JDBC access guide for current NFR limits:
底层JDBC分析服务有严格的限制,请控制请求范围:
- 避免大范围的查询
SELECT * - 使用窄日期范围和增量窗口
- 尽可能优先使用聚合表
- 常用KPI工作流优先使用报表命令
限制可能会随时间变化,你可以查看官方JDBC访问指南了解当前的NFR限制:
Troubleshooting
问题排查
- : set
tenant-id is required(or--tenant-id)SFCC_TENANT_ID - Auth method error: CIP supports client credentials only; remove
--user-auth - 403/unauthorized: verify API client role and tenant filter include target instance
- Rate/timeout failures: reduce date window, select fewer columns, query aggregate tables
For full command reference, use and CLI docs.
b2c cip --help- :设置
tenant-id is required(或--tenant-id)SFCC_TENANT_ID - 认证方式错误:CIP仅支持客户端凭证模式,请移除参数
--user-auth - 403/未授权:验证API客户端角色和租户过滤器是否包含目标实例
- 限流/超时失败:缩小日期窗口、选择更少的列、查询聚合表
完整命令参考请查看和CLI文档。
b2c cip --help