siluzan-tso-cli 1.1.69 → 1.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7415,7 +7415,7 @@ function buildOutlineHints(section) {
7415
7415
  ...GOOGLE_ANALYSIS_CONVERSIONS_VALUE_HINTS
7416
7416
  );
7417
7417
  }
7418
- if (section === "ads" || section === "keywords" || section === "search-terms") {
7418
+ if (section === "ads" || section === "keywords" || section === "search-terms" || section === "daily-metrics" || section === "devices" || section === "campaign-device" || section === "geographic" || section === "geo-targeted" || section === "campaign-geo" || section === "campaign-geo-matched" || section === "geo-matched") {
7419
7419
  hints.push(...GOOGLE_ANALYSIS_CONVERSIONS_VALUE_HINTS);
7420
7420
  }
7421
7421
  if (section === "ads") {
@@ -9560,6 +9560,7 @@ function targetedLocationsToGeographic(raw) {
9560
9560
  ctr: finiteNumber2(row.ctr) / 100,
9561
9561
  spend: finiteNumber2(row.spend),
9562
9562
  conversions: finiteNumber2(row.conversions),
9563
+ conversionsValue: finiteNumber2(row.conversionsValue),
9563
9564
  allConversions: finiteNumber2(row.allConversions),
9564
9565
  averageCpc: finiteNumber2(row.averageCpc),
9565
9566
  conversionRate: finiteNumber2(row.conversionRate),
@@ -105823,6 +105824,7 @@ async function mergeGoogleAnalysisSnapshotIntoReport(payload, snapshotDir) {
105823
105824
  dates: sorted.map((r) => String(r.date ?? "\u2014")),
105824
105825
  cost: sorted.map((r) => round25(num5(r.spend)) ?? 0),
105825
105826
  conversions: sorted.map((r) => Math.round(num5(r.conversions) ?? 0)),
105827
+ conversionsValue: sorted.map((r) => round25(num5(r.conversionsValue)) ?? 0),
105826
105828
  cpa: sorted.map((r) => round25(num5(r.costPerConversion)) ?? 0)
105827
105829
  };
105828
105830
  }
@@ -105851,7 +105853,7 @@ async function mergeGoogleAnalysisSnapshotIntoReport(payload, snapshotDir) {
105851
105853
  {
105852
105854
  const rows = items(sectionMap.get("devices"));
105853
105855
  if (rows.length > 0) {
105854
- tables.devices = rows.map((r) => pickMetricRow(r, ["deviceType"]));
105856
+ tables.devices = rows.map((r) => pickMetricRow(r, ["deviceType", "conversionsValue"]));
105855
105857
  }
105856
105858
  }
105857
105859
  {
@@ -106482,6 +106484,7 @@ function deviceRows(data, lang = "zh") {
106482
106484
  money2(row.spend),
106483
106485
  count(pair.all),
106484
106486
  count(pair.conv),
106487
+ money2(row.conversionsValue),
106485
106488
  num7(row.costPerConversion) == null && pair.conv <= 0 ? "\u2014" : money2(row.costPerConversion),
106486
106489
  rate(row.conversionRate)
106487
106490
  ];
@@ -106506,6 +106509,7 @@ function geoRows(data, lang = "zh") {
106506
106509
  rate(row.ctr),
106507
106510
  count(pair.all),
106508
106511
  count(pair.conv),
106512
+ money2(row.conversionsValue),
106509
106513
  num7(row.costPerConversion) == null && pair.conv <= 0 ? "\u2014" : money2(row.costPerConversion),
106510
106514
  rate(row.conversionRate)
106511
106515
  ];
@@ -106602,10 +106606,11 @@ function buildOkkiWeeklySheetDrafts(data, lang = "zh") {
106602
106606
  "\u8D39\u7528",
106603
106607
  "\u6240\u6709\u8F6C\u5316\u6B21\u6570",
106604
106608
  "\u8F6C\u5316\u6B21\u6570",
106609
+ "\u8F6C\u5316\u4EF7\u503C",
106605
106610
  "\u6BCF\u6B21\u8F6C\u5316\u8D39\u7528",
106606
106611
  "\u8F6C\u5316\u7387"
106607
106612
  ],
106608
- colWidths: [12, 10, 26, 12, 11, 10, 9, 16, 11, 14, 10, 14, 9],
106613
+ colWidths: [12, 10, 26, 12, 11, 10, 9, 16, 11, 14, 10, 12, 14, 9],
106609
106614
  dataRows: deviceRows(data, lang),
106610
106615
  analysisLines: analysisLines(data, "devices")
106611
106616
  },
@@ -106625,10 +106630,11 @@ function buildOkkiWeeklySheetDrafts(data, lang = "zh") {
106625
106630
  "\u70B9\u51FB\u7387",
106626
106631
  "\u6240\u6709\u8F6C\u5316\u6B21\u6570",
106627
106632
  "\u8F6C\u5316\u6B21\u6570",
106633
+ "\u8F6C\u5316\u4EF7\u503C",
106628
106634
  "\u6BCF\u6B21\u8F6C\u5316\u8D39\u7528",
106629
106635
  "\u8F6C\u5316\u7387"
106630
106636
  ],
106631
- colWidths: [16, 26, 11, 11, 9, 11, 11, 10, 9, 14, 10, 14, 9],
106637
+ colWidths: [16, 26, 11, 11, 9, 11, 11, 10, 9, 14, 10, 12, 14, 9],
106632
106638
  dataRows: geoRows(data, lang),
106633
106639
  analysisLines: analysisLines(data, "geo")
106634
106640
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.69",
4
- "publishedAt": 1794831646185
3
+ "version": "1.1.70",
4
+ "publishedAt": 1794832617700
5
5
  }
@@ -138,7 +138,7 @@ siluzan-tso google-analysis -a <id> --exclude materials,gold-account --json-out
138
138
  | `materials` | 图片+视频拍平进 `items[]`,每行带 `assetType: 'image' \| 'video'` |
139
139
  | `resource-counts` | 结构统计 |
140
140
  | `conversion-actions` | 转化动作 |
141
- | `daily-metrics` | 按日指标(主平台 `GET …/report/media-account/google/account-daily-reports`,`--json-out` 落盘为按日数组)。**广告诊断报告**中:金额/CPA **保留 2 位小数**,转化/点击/展示为整数;须配趋势**分析**段落(见 `google-ads-diagnosis.md`) |
141
+ | `daily-metrics` | 按日指标(主平台 `GET …/report/media-account/google/account-daily-reports`,`--json-out` 落盘为按日数组)。行上 `conversionsValue` 是账户币种转化价值。**广告诊断报告**中:金额/CPA/转化价值 **保留 2 位小数**,转化/点击/展示为整数;须配趋势**分析**段落(见 `google-ads-diagnosis.md`) |
142
142
  | `gold-account` | 黄金账户 |
143
143
  | `ads-index` | 质量指标 |
144
144
  | `final-urls` | 最终到达网址(不传 `--start`/`--end`) |
@@ -17,7 +17,7 @@ siluzan-tso google-ads-diagnosis render \
17
17
 
18
18
  ### 撰写要点(摘要)
19
19
 
20
- 1. **每日趋势**(§7 / `daily-metrics`):金额、CPA **保留 2 位小数**;展示/点击/转化用整数;图表 tooltip 同规则。
20
+ 1. **每日趋势**(§7 / `daily-metrics`):金额、CPA、转化价值 **保留 2 位小数**;展示/点击/转化用整数;图表 tooltip 同规则。转化价值读 `conversionsValue`。
21
21
  2. **每一章**除表格外须有 **分析**(≥2 条)+ **建议**(≥1 条);禁止只罗列数据。
22
22
 
23
23
  ---
@@ -104,7 +104,7 @@ siluzan-tso google-ads-diagnosis render \
104
104
  | 金额类(消耗、CPA、CPC、预算等) | **保留 2 位小数**,带货币 | `¥1,234.56 CNY` |
105
105
  | 展示、点击、转化次数 | **整数**,不写长小数 | `1,280` 而非 `1280.000000` |
106
106
  | 比率(CTR、CVR、环比%) | JSON 为 0~1 小数时,展示 `(v×100).toFixed(2)+'%'` | `0.0523` → `5.23%` |
107
- | **每日趋势 / 转化成本曲线** | 数据源:`daily-metrics` 或 `conversionCost.items`(`date`、`cost`、`cpa`、`conversions` 等) | 见下 |
107
+ | **每日趋势 / 转化成本曲线** | 数据源:`daily-metrics` 或 `conversionCost.items`(`date`、`cost`、`cpa`、`conversions`、`conversionsValue`) | 见下 |
108
108
 
109
109
  **每日趋势表与图(§3.5 转化成本 / 按日趋势)**:
110
110
 
@@ -314,7 +314,7 @@ siluzan-tso google-ads-diagnosis render \
314
314
 
315
315
  #### 转化成本 / 按日趋势(若页面已渲染)
316
316
 
317
- - **数据**:`conversionCost.items` 或 `daily-metrics` 落盘数组(含 `date`、`cost`、`cpa`、`conversions`、`clicks` 等)。
317
+ - **数据**:`conversionCost.items` 或 `daily-metrics` 落盘数组(含 `date`、`cost`、`cpa`、`conversions`、`conversionsValue`、`clicks`)。`conversionsValue` 是账户币种转化价值,单独一列,不要用转化次数代替。
318
318
  - **表格**:日期 | 消耗(2 位小数)| 转化(整数)| CPA(2 位小数)— 见上文「每日趋势」格式。
319
319
  - **图表**:折线/双轴图;tooltip 金额 **2 位小数**。
320
320
  - **分析(必填)**:至少 2 条,例如「周内 CPA 波动区间」「转化高峰日 vs 消耗高峰日是否一致」。
@@ -118,7 +118,7 @@ function valueKpis(items) {
118
118
 
119
119
  禁止对行上的 `conversionsValuePerCost` 再平均(那是行级「转化价值/费用」,不是账户 ROAS)。
120
120
 
121
- 关键词、搜索字词、国家/地区、设备表的转化价值读各自行的 `conversionsValue`(账户币种),ROAS = 该值 / 该行 `spend`。禁止把系列汇总摊到词、国家或设备上,也禁止用转化次数估算。这些行若 `conversions` > 0 但 `conversionsValue` 全是 0,而同期 `campaigns` 有转化价值,该列写「未返回」。每日趋势:结束日不是报表当天且每天价值都是 0、转化次数却大于 0 时,写「未返回」(该日快照还没写入价值);结束日是当天且现查返回了非 0 价值,按返回值填写。受众表同样读本行 `conversionsValue`,整列是 0 而同期系列有价值时写「未返回」。`geo-matched` / `campaign-geo` 没有这项查询,写「该维度未返回」。关键词或搜索字词当次 outline 也没有该字段时同样写「未返回」。上期 `campaigns` 拉数失败时,账户级三格写明原因,不要留空。
121
+ 关键词、搜索字词、国家/地区、设备、每日趋势、受众表都要有「转化价值」列,读各自行的 `conversionsValue`(账户币种)。每日趋势读 `daily-metrics` 的 `items[].conversionsValue`;设备读 `devices` 或 `campaign-device`;地域读 `geographic` / `geo-targeted`。ROAS = 该值 / 该行 `spend`(spend 为 0 写「—」)。禁止把系列汇总摊到词、设备、国家或按日上,也禁止用转化次数估算。这些行若 `conversions` > 0 但 `conversionsValue` 全是 0,而同期 `campaigns` 有转化价值,该列写「未返回」。每日趋势:结束日不是报表当天且每天价值都是 0、转化次数却大于 0 时,写「未返回」(该日快照还没写入价值);结束日是当天且现查返回了非 0 价值,按返回值填写。受众表同样读本行 `conversionsValue`,整列是 0 而同期系列有价值时写「未返回」。`geo-matched` / `campaign-geo` 没有这项查询,写「该维度未返回」。行上没有该字段时写「未返回」。关键词或搜索字词当次 outline 也没有该字段时同样写「未返回」。上期 `campaigns` 拉数失败时,账户级三格写明原因,不要留空。
122
122
 
123
123
  英文终稿表头:转化价值 → Conversion value,单转化价值 → Value / conversion,ROAS 保持 ROAS。
124
124
 
@@ -37,7 +37,7 @@ siluzan-tso google-analysis render \
37
37
 
38
38
  - `meta`:`accountId`(必填)/ `accountName` / `currency` / `startDate` / `endDate`;可省略由 `--snapshot-dir` 从 `overview` + manifest 自动合并。
39
39
  - `kpis`:账户级 KPI(消耗/展示/点击/转化/CTR/CPC/CPA,含可选 `previousPeriod` 环比;另含 `activeDays` / `averageDailyCost`);Agent 可省略,但 **render 合并后** `cost`/`impressions`/`clicks` 至少一项须为有效数字,否则拒绝出 HTML(避免执行摘要卡片全「—」)。本期 KPI 由 CLI 优先对 `campaigns` 全系列累加并重算比率;无 campaigns 时回退 `overview.currentPeriod`,再回退 `dimension-summary`。`activeDays` / `averageDailyCost` 来自 `overview.record` 根(**不是** `currentPeriod`);环比仍来自 `overview.previousPeriod`(上期无活跃天数,不编造)。
40
- - `charts.dailyTrend`:每日趋势(`dates`/`cost`/`conversions`/`cpa`);可省略由 `daily-metrics` 自动合并。
40
+ - `charts.dailyTrend`:每日趋势(`dates`/`cost`/`conversions`/`conversionsValue`/`cpa`);可省略由 `daily-metrics` 自动合并。`conversionsValue` 是账户币种转化价值。
41
41
  - `tables.{dimensionSummary,campaigns,devices,geographic,audience,keywords,negativeKeywords}`:对应 §3~§9 表格数据;可省略由同名 `google-analysis` section 自动合并。`negativeKeywords` 合并后必须是数组,**0 条也是 `[]`**。
42
42
  - `narrative`(**Agent 必填,唯一由 Agent 撰写的内容**):
43
43
  - `executiveSummary[]`:≥1 段执行摘要
@@ -67,10 +67,10 @@ siluzan-tso google-analysis render \
67
67
  | # | 维度 | CLI |
68
68
  | --- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
69
69
  | 1 | 执行摘要(消耗/展示/点击/转化/CTR/CPC/CPA 本期概览) | `google-analysis --sections overview` |
70
- | 2 | 每日投放趋势(按日消耗/点击/转化曲线;金额/CPA **2 位小数**,转化/点击整数) | `google-analysis --sections daily-metrics` |
70
+ | 2 | 每日投放趋势(按日消耗/转化/转化价值/CPA;金额与转化价值 **2 位小数**,转化整数) | `google-analysis --sections daily-metrics`(`items[].conversionsValue`) |
71
71
  | 3 | 月度汇总(全周期汇总数据) | `google-analysis --sections dimension-summary` |
72
72
  | 4 | 广告系列表现(预算/出价策略/各系列消耗与效果) | `google-analysis --sections campaigns` |
73
- | 5 | 设备分布(PC/移动/平板 消耗/点击/转化) | `google-analysis --sections devices` |
73
+ | 5 | 设备分布(PC/移动/平板 消耗/点击/转化/转化价值) | `google-analysis --sections devices`(行上 `conversionsValue`) |
74
74
  | 6 | 地域分布(国家/地区消耗、转化价值、ROAS) | `google-analysis --sections geographic` |
75
75
  | 7 | 受众分布(意向/兴趣/再营销/客户匹配等列表表现) | `google-analysis --sections audience`(默认不传 `--audience-type`,系统+自定义一起拉) |
76
76
  | 8 | 关键词表现(词/消耗/CTR/CPC 排行) | `google-analysis --sections keywords`(这个命令获取的关键词数据会来自多个系列,不能合并去重) |
@@ -222,8 +222,8 @@ function deviceKind(deviceType) {
222
222
  | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
223
223
  | R1 | `设备报告` |
224
224
  | R2 | 统计区间 |
225
- | R3(A→M,13 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
226
- | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
225
+ | R3(A→N,14 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `转化价值` \| `每次转化费用` \| `转化率` |
226
+ | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`conversionsValue`→「转化价值」(账户币种金额,不是次数);`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
227
227
  | 表末「分析」 | **总结**:各设备消耗与转化占比、系列×设备高消耗组合、移动端 vs 桌面 CPA/CPC 差异。占比按 `deviceKind` 累加费用(见上文),`deviceType` 是 `Desktop`/`Mobile`,不是 `DESKTOP`/`MOBILE`。桌面费用 ≥ 移动时禁止写「移动端为主要消耗 / 移动端占比高」。**建议**:设备出价系数、落地页或系列倾斜(须引用设备类型与表中费用/转化),1~3 条;`okki-render` 不改写建议原文 |
228
228
 
229
229
  ---
@@ -234,8 +234,8 @@ function deviceKind(deviceType) {
234
234
  | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235
235
  | R1 | `地理位置报告` |
236
236
  | R2 | 统计区间 |
237
- | R3(A→M,13 列) | `地理位置` \| `广告系列` \| `展示次数` \| `互动次数` \| `互动率` \| `费用` \| `平均费用` \| `点击次数` \| `点击率` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
238
- | R4… | `geo-targeted-*.json` 的 `items[]`(`schemaVersion 3` 行统一在 `items`):`countryOrRegion`→地理位置;`campaignName`→「广告系列」;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;**互动次数**→`interactions`,缺省/为 0 时回退 `clicks`(当前定位接口常不回 interactions);**互动率**→`interactionRate`(字符串须解析)或 `互动次数/impressions`,回退后仍为 0 才填 `—`;**平均费用** = `spend / 互动次数`(同样先 interactions 再 clicks),分母为 0 时填 `—`;`ctr` / `conversionRate` 直接写入;其余列按 outline 映射 |
237
+ | R3(A→N,14 列) | `地理位置` \| `广告系列` \| `展示次数` \| `互动次数` \| `互动率` \| `费用` \| `平均费用` \| `点击次数` \| `点击率` \| `所有转化次数` \| `转化次数` \| `转化价值` \| `每次转化费用` \| `转化率` |
238
+ | R4… | `geo-targeted-*.json` 的 `items[]`(`schemaVersion 3` 行统一在 `items`):`countryOrRegion`→地理位置;`campaignName`→「广告系列」;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`conversionsValue`→「转化价值」(账户币种金额,不是次数);**互动次数**→`interactions`,缺省/为 0 时回退 `clicks`(当前定位接口常不回 interactions);**互动率**→`interactionRate`(字符串须解析)或 `互动次数/impressions`,回退后仍为 0 才填 `—`;**平均费用** = `spend / 互动次数`(同样先 interactions 再 clicks),分母为 0 时填 `—`;`ctr` / `conversionRate` 直接写入;其余列按 outline 映射 |
239
239
  | 表末「分析」 | **总结**:Top 国家/地区消耗与转化、高消耗低转化地域、系列×地域组合。**建议**:地域加价/降价、排除或单独系列(须写国家/地区名 + 表中费用/转化/CPA),1~3 条 |
240
240
 
241
241
  ---
@@ -17,7 +17,7 @@ siluzan-tso google-ads-diagnosis render \
17
17
 
18
18
  ### 撰写要点(摘要)
19
19
 
20
- 1. **每日趋势**(§7 / `daily-metrics`):金额、CPA **保留 2 位小数**;展示/点击/转化用整数;图表 tooltip 同规则。
20
+ 1. **每日趋势**(§7 / `daily-metrics`):金额、CPA、转化价值 **保留 2 位小数**;展示/点击/转化用整数;图表 tooltip 同规则。转化价值读 `conversionsValue`。
21
21
  2. **每一章**除表格外须有 **分析**(≥2 条)+ **建议**(≥1 条);禁止只罗列数据。
22
22
 
23
23
  ---
@@ -104,7 +104,7 @@ siluzan-tso google-ads-diagnosis render \
104
104
  | 金额类(消耗、CPA、CPC、预算等) | **保留 2 位小数**,带货币 | `¥1,234.56 CNY` |
105
105
  | 展示、点击、转化次数 | **整数**,不写长小数 | `1,280` 而非 `1280.000000` |
106
106
  | 比率(CTR、CVR、环比%) | JSON 为 0~1 小数时,展示 `(v×100).toFixed(2)+'%'` | `0.0523` → `5.23%` |
107
- | **每日趋势 / 转化成本曲线** | 数据源:`daily-metrics` 或 `conversionCost.items`(`date`、`cost`、`cpa`、`conversions` 等) | 见下 |
107
+ | **每日趋势 / 转化成本曲线** | 数据源:`daily-metrics` 或 `conversionCost.items`(`date`、`cost`、`cpa`、`conversions`、`conversionsValue`) | 见下 |
108
108
 
109
109
  **每日趋势表与图(§3.5 转化成本 / 按日趋势)**:
110
110
 
@@ -314,7 +314,7 @@ siluzan-tso google-ads-diagnosis render \
314
314
 
315
315
  #### 转化成本 / 按日趋势(若页面已渲染)
316
316
 
317
- - **数据**:`conversionCost.items` 或 `daily-metrics` 落盘数组(含 `date`、`cost`、`cpa`、`conversions`、`clicks` 等)。
317
+ - **数据**:`conversionCost.items` 或 `daily-metrics` 落盘数组(含 `date`、`cost`、`cpa`、`conversions`、`conversionsValue`、`clicks`)。`conversionsValue` 是账户币种转化价值,单独一列,不要用转化次数代替。
318
318
  - **表格**:日期 | 消耗(2 位小数)| 转化(整数)| CPA(2 位小数)— 见上文「每日趋势」格式。
319
319
  - **图表**:折线/双轴图;tooltip 金额 **2 位小数**。
320
320
  - **分析(必填)**:至少 2 条,例如「周内 CPA 波动区间」「转化高峰日 vs 消耗高峰日是否一致」。
@@ -118,7 +118,7 @@ function valueKpis(items) {
118
118
 
119
119
  禁止对行上的 `conversionsValuePerCost` 再平均(那是行级「转化价值/费用」,不是账户 ROAS)。
120
120
 
121
- 关键词、搜索字词、国家/地区、设备表的转化价值读各自行的 `conversionsValue`(账户币种),ROAS = 该值 / 该行 `spend`。禁止把系列汇总摊到词、国家或设备上,也禁止用转化次数估算。这些行若 `conversions` > 0 但 `conversionsValue` 全是 0,而同期 `campaigns` 有转化价值,该列写「未返回」。每日趋势:结束日不是报表当天且每天价值都是 0、转化次数却大于 0 时,写「未返回」(该日快照还没写入价值);结束日是当天且现查返回了非 0 价值,按返回值填写。受众表同样读本行 `conversionsValue`,整列是 0 而同期系列有价值时写「未返回」。`geo-matched` / `campaign-geo` 没有这项查询,写「该维度未返回」。关键词或搜索字词当次 outline 也没有该字段时同样写「未返回」。上期 `campaigns` 拉数失败时,账户级三格写明原因,不要留空。
121
+ 关键词、搜索字词、国家/地区、设备、每日趋势、受众表都要有「转化价值」列,读各自行的 `conversionsValue`(账户币种)。每日趋势读 `daily-metrics` 的 `items[].conversionsValue`;设备读 `devices` 或 `campaign-device`;地域读 `geographic` / `geo-targeted`。ROAS = 该值 / 该行 `spend`(spend 为 0 写「—」)。禁止把系列汇总摊到词、设备、国家或按日上,也禁止用转化次数估算。这些行若 `conversions` > 0 但 `conversionsValue` 全是 0,而同期 `campaigns` 有转化价值,该列写「未返回」。每日趋势:结束日不是报表当天且每天价值都是 0、转化次数却大于 0 时,写「未返回」(该日快照还没写入价值);结束日是当天且现查返回了非 0 价值,按返回值填写。受众表同样读本行 `conversionsValue`,整列是 0 而同期系列有价值时写「未返回」。`geo-matched` / `campaign-geo` 没有这项查询,写「该维度未返回」。行上没有该字段时写「未返回」。关键词或搜索字词当次 outline 也没有该字段时同样写「未返回」。上期 `campaigns` 拉数失败时,账户级三格写明原因,不要留空。
122
122
 
123
123
  英文终稿表头:转化价值 → Conversion value,单转化价值 → Value / conversion,ROAS 保持 ROAS。
124
124
 
@@ -863,9 +863,10 @@
863
863
 
864
864
  function renderDailyTrend(data) {
865
865
  const chart = data.charts?.dailyTrend || {};
866
+ const currency = data.meta?.currency || "CNY";
866
867
  const dates = Array.isArray(chart.dates) ? chart.dates : [];
867
868
  const section = data.narrative?.sections?.dailyTrend;
868
- const head = sectionHead("02", "每日投放趋势", "按日消耗 / 转化 / CPA 曲线");
869
+ const head = sectionHead("02", "每日投放趋势", "按日消耗 / 转化 / 转化价值 / CPA");
869
870
  if (dates.length === 0) {
870
871
  return `
871
872
  <section id="sec-daily-trend">
@@ -876,11 +877,28 @@
876
877
  </div>
877
878
  </section>`;
878
879
  }
880
+ const values = Array.isArray(chart.conversionsValue) ? chart.conversionsValue : [];
881
+ const body = dates
882
+ .map(
883
+ (d, i) => `
884
+ <tr>
885
+ <td>${escapeHtml(d)}</td>
886
+ <td class="num">${money(chart.cost?.[i], currency)}</td>
887
+ <td class="num">${int(chart.conversions?.[i])}</td>
888
+ <td class="num">${money(values[i], currency)}</td>
889
+ <td class="num">${money(chart.cpa?.[i], currency)}</td>
890
+ </tr>`,
891
+ )
892
+ .join("");
879
893
  return `
880
894
  <section id="sec-daily-trend">
881
895
  ${head}
882
896
  <div class="card">
883
897
  <div id="chart-daily-trend" class="chart-box"></div>
898
+ <div class="table-wrap"><table>
899
+ <thead><tr><th>日期</th><th class="num">消耗</th><th class="num">转化</th><th class="num">转化价值</th><th class="num">CPA</th></tr></thead>
900
+ <tbody>${body}</tbody>
901
+ </table></div>
884
902
  ${analysisBlock(section)}
885
903
  </div>
886
904
  </section>`;
@@ -976,6 +994,7 @@
976
994
  <td class="num">${int(r.clicks)}</td>
977
995
  <td class="num">${pct(r.ctr)}</td>
978
996
  <td class="num">${int(r.conversions)}</td>
997
+ <td class="num">${money(r.conversionsValue, currency)}</td>
979
998
  <td class="num">${money(r.costPerConversion, currency)}</td>
980
999
  </tr>`,
981
1000
  )
@@ -984,7 +1003,7 @@
984
1003
  sorted.length > 0
985
1004
  ? `<div id="chart-devices" class="chart-box" style="height:280px"></div>
986
1005
  <div class="table-wrap"><table>
987
- <thead><tr><th>设备</th><th class="num">消耗</th><th class="num">展示</th><th class="num">点击</th><th class="num">CTR</th><th class="num">转化</th><th class="num">CPA</th></tr></thead>
1006
+ <thead><tr><th>设备</th><th class="num">消耗</th><th class="num">展示</th><th class="num">点击</th><th class="num">CTR</th><th class="num">转化</th><th class="num">转化价值</th><th class="num">CPA</th></tr></thead>
988
1007
  <tbody>${body}</tbody>
989
1008
  </table></div>`
990
1009
  : '<div class="empty-note">数据不可用:devices 未拉取</div>';
@@ -1237,7 +1256,7 @@
1237
1256
  formatter: (params) =>
1238
1257
  params
1239
1258
  .map((p) => {
1240
- if (p.seriesName === "消耗" || p.seriesName === "CPA") {
1259
+ if (p.seriesName === "消耗" || p.seriesName === "CPA" || p.seriesName === "转化价值") {
1241
1260
  return `${p.marker}${p.seriesName}: ${fixed2(p.value)}`;
1242
1261
  }
1243
1262
  return `${p.marker}${p.seriesName}: ${int(p.value)}`;
@@ -1246,7 +1265,7 @@
1246
1265
  },
1247
1266
  TOOLTIP_STYLE,
1248
1267
  ),
1249
- legend: { data: ["消耗", "转化", "CPA"], textStyle: { color: AXIS_COLOR }, top: 0 },
1268
+ legend: { data: ["消耗", "转化", "转化价值", "CPA"], textStyle: { color: AXIS_COLOR }, top: 0 },
1250
1269
  grid: { left: 52, right: 52, top: 44, bottom: 30 },
1251
1270
  xAxis: styleAxis({ type: "category", data: daily.dates, boundaryGap: false }),
1252
1271
  yAxis: [
@@ -1276,6 +1295,14 @@
1276
1295
  barMaxWidth: 18,
1277
1296
  itemStyle: { color: "rgba(16,185,129,0.55)", borderRadius: [4, 4, 0, 0] },
1278
1297
  },
1298
+ {
1299
+ name: "转化价值",
1300
+ type: "line",
1301
+ data: daily.conversionsValue || [],
1302
+ smooth: true,
1303
+ showSymbol: false,
1304
+ lineStyle: { width: 2, color: PALETTE[2] },
1305
+ },
1279
1306
  {
1280
1307
  name: "CPA",
1281
1308
  type: "line",
@@ -37,7 +37,7 @@ siluzan-tso google-analysis render \
37
37
 
38
38
  - `meta`:`accountId`(必填)/ `accountName` / `currency` / `startDate` / `endDate`;可省略由 `--snapshot-dir` 从 `overview` + manifest 自动合并。
39
39
  - `kpis`:账户级 KPI(消耗/展示/点击/转化/CTR/CPC/CPA,含可选 `previousPeriod` 环比;另含 `activeDays` / `averageDailyCost`);Agent 可省略,但 **render 合并后** `cost`/`impressions`/`clicks` 至少一项须为有效数字,否则拒绝出 HTML(避免执行摘要卡片全「—」)。本期 KPI 由 CLI 优先对 `campaigns` 全系列累加并重算比率;无 campaigns 时回退 `overview.currentPeriod`,再回退 `dimension-summary`。`activeDays` / `averageDailyCost` 来自 `overview.record` 根(**不是** `currentPeriod`);环比仍来自 `overview.previousPeriod`(上期无活跃天数,不编造)。
40
- - `charts.dailyTrend`:每日趋势(`dates`/`cost`/`conversions`/`cpa`);可省略由 `daily-metrics` 自动合并。
40
+ - `charts.dailyTrend`:每日趋势(`dates`/`cost`/`conversions`/`conversionsValue`/`cpa`);可省略由 `daily-metrics` 自动合并。`conversionsValue` 是账户币种转化价值。
41
41
  - `tables.{dimensionSummary,campaigns,devices,geographic,audience,keywords,negativeKeywords}`:对应 §3~§9 表格数据;可省略由同名 `google-analysis` section 自动合并。`negativeKeywords` 合并后必须是数组,**0 条也是 `[]`**。
42
42
  - `narrative`(**Agent 必填,唯一由 Agent 撰写的内容**):
43
43
  - `executiveSummary[]`:≥1 段执行摘要
@@ -67,10 +67,10 @@ siluzan-tso google-analysis render \
67
67
  | # | 维度 | CLI |
68
68
  | --- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
69
69
  | 1 | 执行摘要(消耗/展示/点击/转化/CTR/CPC/CPA 本期概览) | `google-analysis --sections overview` |
70
- | 2 | 每日投放趋势(按日消耗/点击/转化曲线;金额/CPA **2 位小数**,转化/点击整数) | `google-analysis --sections daily-metrics` |
70
+ | 2 | 每日投放趋势(按日消耗/转化/转化价值/CPA;金额与转化价值 **2 位小数**,转化整数) | `google-analysis --sections daily-metrics`(`items[].conversionsValue`) |
71
71
  | 3 | 月度汇总(全周期汇总数据) | `google-analysis --sections dimension-summary` |
72
72
  | 4 | 广告系列表现(预算/出价策略/各系列消耗与效果) | `google-analysis --sections campaigns` |
73
- | 5 | 设备分布(PC/移动/平板 消耗/点击/转化) | `google-analysis --sections devices` |
73
+ | 5 | 设备分布(PC/移动/平板 消耗/点击/转化/转化价值) | `google-analysis --sections devices`(行上 `conversionsValue`) |
74
74
  | 6 | 地域分布(国家/地区消耗、转化价值、ROAS) | `google-analysis --sections geographic` |
75
75
  | 7 | 受众分布(意向/兴趣/再营销/客户匹配等列表表现) | `google-analysis --sections audience`(默认不传 `--audience-type`,系统+自定义一起拉) |
76
76
  | 8 | 关键词表现(词/消耗/CTR/CPC 排行) | `google-analysis --sections keywords`(这个命令获取的关键词数据会来自多个系列,不能合并去重) |
@@ -222,8 +222,8 @@ function deviceKind(deviceType) {
222
222
  | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
223
223
  | R1 | `设备报告` |
224
224
  | R2 | 统计区间 |
225
- | R3(A→M,13 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
226
- | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
225
+ | R3(A→N,14 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `转化价值` \| `每次转化费用` \| `转化率` |
226
+ | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`conversionsValue`→「转化价值」(账户币种金额,不是次数);`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
227
227
  | 表末「分析」 | **总结**:各设备消耗与转化占比、系列×设备高消耗组合、移动端 vs 桌面 CPA/CPC 差异。占比按 `deviceKind` 累加费用(见上文),`deviceType` 是 `Desktop`/`Mobile`,不是 `DESKTOP`/`MOBILE`。桌面费用 ≥ 移动时禁止写「移动端为主要消耗 / 移动端占比高」。**建议**:设备出价系数、落地页或系列倾斜(须引用设备类型与表中费用/转化),1~3 条;`okki-render` 不改写建议原文 |
228
228
 
229
229
  ---
@@ -234,8 +234,8 @@ function deviceKind(deviceType) {
234
234
  | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235
235
  | R1 | `地理位置报告` |
236
236
  | R2 | 统计区间 |
237
- | R3(A→M,13 列) | `地理位置` \| `广告系列` \| `展示次数` \| `互动次数` \| `互动率` \| `费用` \| `平均费用` \| `点击次数` \| `点击率` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
238
- | R4… | `geo-targeted-*.json` 的 `items[]`(`schemaVersion 3` 行统一在 `items`):`countryOrRegion`→地理位置;`campaignName`→「广告系列」;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;**互动次数**→`interactions`,缺省/为 0 时回退 `clicks`(当前定位接口常不回 interactions);**互动率**→`interactionRate`(字符串须解析)或 `互动次数/impressions`,回退后仍为 0 才填 `—`;**平均费用** = `spend / 互动次数`(同样先 interactions 再 clicks),分母为 0 时填 `—`;`ctr` / `conversionRate` 直接写入;其余列按 outline 映射 |
237
+ | R3(A→N,14 列) | `地理位置` \| `广告系列` \| `展示次数` \| `互动次数` \| `互动率` \| `费用` \| `平均费用` \| `点击次数` \| `点击率` \| `所有转化次数` \| `转化次数` \| `转化价值` \| `每次转化费用` \| `转化率` |
238
+ | R4… | `geo-targeted-*.json` 的 `items[]`(`schemaVersion 3` 行统一在 `items`):`countryOrRegion`→地理位置;`campaignName`→「广告系列」;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`conversionsValue`→「转化价值」(账户币种金额,不是次数);**互动次数**→`interactions`,缺省/为 0 时回退 `clicks`(当前定位接口常不回 interactions);**互动率**→`interactionRate`(字符串须解析)或 `互动次数/impressions`,回退后仍为 0 才填 `—`;**平均费用** = `spend / 互动次数`(同样先 interactions 再 clicks),分母为 0 时填 `—`;`ctr` / `conversionRate` 直接写入;其余列按 outline 映射 |
239
239
  | 表末「分析」 | **总结**:Top 国家/地区消耗与转化、高消耗低转化地域、系列×地域组合。**建议**:地域加价/降价、排除或单独系列(须写国家/地区名 + 表中费用/转化/CPA),1~3 条 |
240
240
 
241
241
  ---
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  $PKG_NAME = 'siluzan-tso-cli'
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- $PKG_VERSION = '1.1.69'
12
+ $PKG_VERSION = '1.1.70'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
15
  $INSTALL_CMD = 'npm install -g siluzan-tso-cli'
@@ -9,7 +9,7 @@ set -euo pipefail
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  readonly PKG_NAME="siluzan-tso-cli"
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- readonly PKG_VERSION="1.1.69"
12
+ readonly PKG_VERSION="1.1.70"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
15
  readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.69",
3
+ "version": "1.1.70",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",