@adkit/cli 1.12.12 → 1.12.14

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.
Files changed (2) hide show
  1. package/dist/cli.js +42 -17
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1830,8 +1830,8 @@ var NEGATIVE_LIST_LIST_FLAGS = ["status", "limit", "offset"];
1830
1830
  var NEGATIVE_LIST_ATTACH_FLAGS = ["campaign"];
1831
1831
  var SEARCH_TERMS_FLAGS = ["campaign", "ad-group", "keyword", "keyword-match-type", "period", "from", "to", "min-impressions", "sort", "limit", "raw"];
1832
1832
  var PLACEMENT_REPORT_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "raw"];
1833
- var GOOGLE_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "breakdown", "raw"];
1834
- var GOOGLE_KEYWORD_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "raw"];
1833
+ var GOOGLE_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "breakdown", "fields", "raw"];
1834
+ var GOOGLE_KEYWORD_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "fields", "raw"];
1835
1835
  var KEYWORD_RESEARCH_FLAGS = ["url", "location", "language", "limit", "min-volume"];
1836
1836
  var TARGETING_RESEARCH_FLAGS = ["limit"];
1837
1837
  function generateCampaignName2() {
@@ -2560,17 +2560,27 @@ async function detachNegativeList(client, args, flags) {
2560
2560
  const path3 = `/manage/google/keywords/negative-lists/detach${qs}`;
2561
2561
  return client.post(path3, body);
2562
2562
  }
2563
- function inferGoogleResultsLevel(campaignId, adGroupId) {
2563
+ function parseGoogleResultsLevelArg(args) {
2564
+ const [rawLevel, ...unexpectedArgs] = args;
2565
+ if (!rawLevel) return void 0;
2566
+ const level = rawLevel.trim().toLowerCase();
2567
+ if (level !== "campaigns" && level !== "ad-groups" && level !== "ads") throw new CliError("UNKNOWN_COMMAND", `Unknown action: google results ${rawLevel}`, "Available: campaigns, ad-groups, ads, keywords, placements, search-terms");
2568
+ if (unexpectedArgs.length > 0) throw new CliError("UNKNOWN_COMMAND", `Unknown argument after google results ${rawLevel}: ${unexpectedArgs.join(" ")}`, `Run: adkit manage google results ${level} --help`);
2569
+ return level;
2570
+ }
2571
+ function inferGoogleResultsLevel(campaignId, adGroupId, explicitLevel) {
2572
+ if (explicitLevel) return explicitLevel;
2564
2573
  if (adGroupId) return "ad-groups";
2565
2574
  if (campaignId) return "campaigns";
2566
2575
  return void 0;
2567
2576
  }
2568
- async function listGoogleResults(client, _args, flags) {
2577
+ async function listGoogleResults(client, args, flags) {
2569
2578
  validateFlags(flags, GOOGLE_RESULTS_FLAGS, "manage google results");
2570
2579
  const accountId = typeof flags.account === "string" ? flags.account : void 0;
2571
2580
  const campaignId = typeof flags.campaign === "string" ? flags.campaign : void 0;
2572
2581
  const adGroupId = typeof flags["ad-group"] === "string" ? flags["ad-group"] : void 0;
2573
- const level = inferGoogleResultsLevel(campaignId, adGroupId);
2582
+ const explicitLevel = parseGoogleResultsLevelArg(args);
2583
+ const level = inferGoogleResultsLevel(campaignId, adGroupId, explicitLevel);
2574
2584
  const period = typeof flags.period === "string" ? flags.period : void 0;
2575
2585
  const from = typeof flags.from === "string" ? flags.from : void 0;
2576
2586
  const to = typeof flags.to === "string" ? flags.to : void 0;
@@ -3952,6 +3962,7 @@ var require2 = createRequire(import.meta.url);
3952
3962
  var CLI_VERSION = require2("../package.json").version;
3953
3963
  var DEFAULT_BASE_URL = "https://app.adkit.so/api/v1";
3954
3964
  var GOOGLE_NUMERIC_ID_PATTERN = /^\d+$/;
3965
+ var GOOGLE_RESULTS_LEVEL_ACTIONS = /* @__PURE__ */ new Set(["campaigns", "ad-groups", "ads"]);
3955
3966
  var TIKTOK_NUMERIC_ID_PATTERN = /^\d+$/;
3956
3967
  var USAGE = `
3957
3968
  Usage: adkit <command> [options]
@@ -5016,6 +5027,9 @@ var GOOGLE_NEGATIVE_LIST_HELP_FULL = GOOGLE_NEGATIVE_LIST_HELP;
5016
5027
  var GOOGLE_RESULTS_HELP = `adkit manage google results \u2014 Google Ads performance analytics
5017
5028
 
5018
5029
  [default] Account-wide or filtered performance metrics
5030
+ campaigns One row per campaign
5031
+ ad-groups One row per ad group
5032
+ ads One row per ad
5019
5033
  keywords Keyword-level spend, clicks, impressions per keyword
5020
5034
  placements Placement report: websites, apps, and YouTube
5021
5035
  search-terms Search terms that triggered your ads
@@ -5029,19 +5043,26 @@ Flags:
5029
5043
  --sort <field> Sort by: cost, clicks, impressions, conversions (default: cost)
5030
5044
  --limit <n> Max results
5031
5045
  --status <s> Filter: enabled, paused, all
5032
- --breakdown <b> Split rows by: day, device, network (For placements, use "results placements")
5033
- --fields <list> Response fields, e.g. cost,clicks,searchImpressionShare. Competitive metrics are opt-in.
5046
+ --breakdown <b> Split rows by: day, device, network. For campaign/ad-group/ad rows, use the level subcommands above.
5047
+ --fields <list> Response fields, e.g. cost,clicks,searchImpressionShare. Omit for default advertiser metrics; use all for every supported field.
5034
5048
  --raw Return raw Google API response
5035
5049
  --account <id> Optional if one Google Ads account is connected
5036
5050
 
5037
- Competitive metrics (opt-in via --fields):
5051
+ Default metrics include:
5052
+ Cost/clicks/conversions, CPA, CVR, ROAS, all conversions, view-through conversions,
5053
+ top-position rates, search impression share where Google supports it, and serving/learning status.
5054
+
5055
+ Visibility fields:
5038
5056
  Search: searchImpressionShare, searchRankLostImpressionShare, searchBudgetLostImpressionShare,
5039
- searchTopImpressionShare, searchAbsoluteTopImpressionShare, searchClickShare
5040
- Content: contentImpressionShare, contentRankLostImpressionShare, contentBudgetLostImpressionShare
5057
+ searchTopImpressionShare, searchAbsoluteTopImpressionShare, searchClickShare (default where supported)
5058
+ Content: contentImpressionShare, contentRankLostImpressionShare, contentBudgetLostImpressionShare (use --fields all)
5041
5059
  Note: search fields available at all levels except ads. Content fields not available at keywords or ads.
5042
5060
 
5043
5061
  Examples:
5044
5062
  adkit manage google results
5063
+ adkit manage google results campaigns --account 1234567890 --period 30d
5064
+ adkit manage google results ad-groups --campaign 123 --period 30d
5065
+ adkit manage google results ads --campaign 123 --period 30d
5045
5066
  adkit manage google results keywords --account 1234567890 --period 7d
5046
5067
  adkit manage google results --campaign 123 --period 7d
5047
5068
  adkit manage google results --campaign 123 --period 7d --breakdown day
@@ -5049,7 +5070,7 @@ Examples:
5049
5070
  adkit manage google results placements --campaign 123 --period 30d
5050
5071
  adkit manage google results --period this_month --sort clicks --limit 20
5051
5072
  adkit manage google results search-terms --campaign 123 --period 30d
5052
- adkit manage google results --campaign 123 --fields default,searchImpressionShare,searchBudgetLostImpressionShare`;
5073
+ adkit manage google results --campaign 123 --fields all`;
5053
5074
  var GOOGLE_RESULTS_PLACEMENTS_HELP = `adkit manage google results placements \u2014 Google placement report
5054
5075
 
5055
5076
  Shows each website, app, or YouTube placement where ads appeared.
@@ -5112,12 +5133,13 @@ Flags:
5112
5133
  --sort <field> Sort by: cost (default), clicks, impressions, conversions, ctr, cpc
5113
5134
  --status <s> Filter: enabled, paused, all (default: all)
5114
5135
  --limit <n> Max results
5115
- --fields <list> Response fields, e.g. cost,clicks,qualityScore,searchImpressionShare
5136
+ --fields <list> Response fields, e.g. cost,clicks,qualityScore,searchImpressionShare. Omit for default advertiser metrics.
5116
5137
  --raw Return raw Google API response
5117
5138
 
5118
- Search competitive fields also available at keyword level:
5119
- searchImpressionShare, searchRankLostImpressionShare, searchBudgetLostImpressionShare,
5120
- searchTopImpressionShare, searchAbsoluteTopImpressionShare, searchClickShare
5139
+ Default keyword metrics include CPA, CVR, ROAS, search impression share, search lost impression share,
5140
+ search click share, primary serving/learning status, and Quality Score diagnostics.
5141
+ Extra keyword diagnostics are available with --fields all, including:
5142
+ systemServingStatus, approvalStatus, firstPageCpc, topOfPageCpc, firstPositionCpc
5121
5143
 
5122
5144
  Examples:
5123
5145
  adkit manage google results keywords --account 1234567890 --period 7d
@@ -5125,7 +5147,7 @@ Examples:
5125
5147
  adkit manage google results keywords --account 1234567890 --campaign 987654321 --period this_month
5126
5148
  adkit manage google results keywords --account 1234567890 --period last_month --fields cost,clicks,qualityScore
5127
5149
  adkit manage google results keywords --account 1234567890 --period 7d --fields default,primaryStatus
5128
- adkit manage google results keywords --account 1234567890 --period 30d --fields default,searchImpressionShare`;
5150
+ adkit manage google results keywords --account 1234567890 --period 30d --fields all`;
5129
5151
  var GOOGLE_RESEARCH_HELP = `adkit manage google research \u2014 Google Ads research tools
5130
5152
 
5131
5153
  keywords <query> Get keyword ideas from Google Keyword Planner
@@ -7080,7 +7102,10 @@ async function main() {
7080
7102
  } else if (action === "keywords") {
7081
7103
  data = await listGoogleKeywordResults(client, restArgs, flags);
7082
7104
  emptyHint = "No keyword results found. Try a wider date range or check --status.";
7083
- } else if (action) throw new CliError("UNKNOWN_COMMAND", `Unknown action: google results ${action}`, "Available: keywords, placements, search-terms");
7105
+ } else if (action && GOOGLE_RESULTS_LEVEL_ACTIONS.has(action.toLowerCase())) {
7106
+ data = await listGoogleResults(client, [action, ...restArgs], flags);
7107
+ emptyHint = "No Google results found for the given level. Try a wider date range or remove filters.";
7108
+ } else if (action) throw new CliError("UNKNOWN_COMMAND", `Unknown action: google results ${action}`, "Available: campaigns, ad-groups, ads, keywords, placements, search-terms");
7084
7109
  else data = await listGoogleResults(client, restArgs, flags);
7085
7110
  break;
7086
7111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adkit/cli",
3
- "version": "1.12.12",
3
+ "version": "1.12.14",
4
4
  "description": "The Ads CLI for AI agents — manage Meta & Google ad campaigns, browse the ad library, and generate creatives from your terminal.",
5
5
  "keywords": [
6
6
  "ads cli",