@adkit/cli 1.13.36 → 1.13.37
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/cli.js +60 -10
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2017,8 +2017,8 @@ var ASSET_CREATE_FLAGS = ["type", "text", "sitelink", "header", "value", "descri
|
|
|
2017
2017
|
var ASSET_LINK_FLAGS = ["type", "scope", "scope-id", "status"];
|
|
2018
2018
|
var MEDIA_UPLOAD_FLAGS = ["file", "url", "base64", "adkit-media", "video-id", "filename", "content-type", "name"];
|
|
2019
2019
|
var CAMPAIGN_LIST_FLAGS = ["status", "limit", "offset"];
|
|
2020
|
-
var CAMPAIGN_CREATE_FLAGS = ["name", "status", "budget-daily", "campaign-type", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "conversion-goals", "countries"];
|
|
2021
|
-
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "conversion-goals", "countries"];
|
|
2020
|
+
var CAMPAIGN_CREATE_FLAGS = ["ai-max", "name", "status", "budget-daily", "campaign-type", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "conversion-goals", "countries"];
|
|
2021
|
+
var CAMPAIGN_UPDATE_FLAGS = ["ai-max", "name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "conversion-goals", "countries"];
|
|
2022
2022
|
var ASSET_GROUP_LIST_FLAGS = ["campaign", "limit", "offset"];
|
|
2023
2023
|
var ASSET_GROUP_CREATE_FLAGS = ["campaign", "name", "status", "final-url"];
|
|
2024
2024
|
var ASSET_GROUP_UPDATE_FLAGS = ["name", "status", "final-url"];
|
|
@@ -2310,6 +2310,7 @@ function resolveAssetScope(flags) {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
function buildCampaignPayload2(flags) {
|
|
2312
2312
|
const payload = {};
|
|
2313
|
+
if (flags["ai-max"] !== void 0) payload.aiMax = parseGoogleCampaignAiMaxFlag(flags["ai-max"]);
|
|
2313
2314
|
if (typeof flags.name === "string") payload.name = flags.name;
|
|
2314
2315
|
if (typeof flags.status === "string") payload.status = flags.status;
|
|
2315
2316
|
if (typeof flags["campaign-type"] === "string") payload.campaignType = flags["campaign-type"];
|
|
@@ -2324,6 +2325,11 @@ function buildCampaignPayload2(flags) {
|
|
|
2324
2325
|
if (typeof flags.countries === "string") payload.countries = parseCampaignCountries(flags.countries);
|
|
2325
2326
|
return payload;
|
|
2326
2327
|
}
|
|
2328
|
+
function parseGoogleCampaignAiMaxFlag(value) {
|
|
2329
|
+
if (value === true || value === "true") return { enabled: true };
|
|
2330
|
+
if (value === false || value === "false") return { enabled: false };
|
|
2331
|
+
throw new CliError("INVALID_VALUE", "Invalid --ai-max value", "Use --ai-max true or --ai-max false");
|
|
2332
|
+
}
|
|
2327
2333
|
function parseCampaignCountries(value) {
|
|
2328
2334
|
const countryParts = value.split(",");
|
|
2329
2335
|
const normalizedCountries = countryParts.map((country) => country.trim().toUpperCase());
|
|
@@ -2337,6 +2343,7 @@ function parseCampaignConversionGoals(value) {
|
|
|
2337
2343
|
}
|
|
2338
2344
|
function buildCampaignUpdatePayloadFromFlags(flags) {
|
|
2339
2345
|
const payload = {};
|
|
2346
|
+
if (flags["ai-max"] !== void 0) payload.aiMax = parseGoogleCampaignAiMaxFlag(flags["ai-max"]);
|
|
2340
2347
|
if (typeof flags.name === "string") payload.name = flags.name;
|
|
2341
2348
|
if (typeof flags.status === "string") payload.status = flags.status;
|
|
2342
2349
|
if (typeof flags["budget-daily"] === "string") payload.budget = { daily: Number.parseFloat(flags["budget-daily"]) };
|
|
@@ -2778,9 +2785,11 @@ async function listGoogleAssetGroups(client, _args, flags) {
|
|
|
2778
2785
|
return client.get(`/manage/google/asset-groups${qs}`);
|
|
2779
2786
|
}
|
|
2780
2787
|
async function getGoogleAssetGroup(client, args, flags) {
|
|
2781
|
-
validateFlags(flags, ["raw"], "manage google asset-groups <id>");
|
|
2788
|
+
validateFlags(flags, ["raw", "fields"], "manage google asset-groups <id>");
|
|
2782
2789
|
const id = requireGoogleNumericId(args, "asset-group-id", "Run: adkit manage google asset-groups <asset-group-id>");
|
|
2783
|
-
const
|
|
2790
|
+
const fields = typeof flags.fields === "string" ? flags.fields : void 0;
|
|
2791
|
+
const qs = buildGoogleListQuery(flags, { fields });
|
|
2792
|
+
if (fields !== void 0) delete flags.fields;
|
|
2784
2793
|
return client.get(`/manage/google/asset-groups/${id}${qs}`);
|
|
2785
2794
|
}
|
|
2786
2795
|
async function createGoogleAssetGroup(client, _args, flags) {
|
|
@@ -3063,7 +3072,7 @@ function parseGoogleResultsLevelArg(args) {
|
|
|
3063
3072
|
const [rawLevel, ...unexpectedArgs] = args;
|
|
3064
3073
|
if (!rawLevel) return void 0;
|
|
3065
3074
|
const level = rawLevel.trim().toLowerCase();
|
|
3066
|
-
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");
|
|
3075
|
+
if (level !== "campaigns" && level !== "ad-groups" && level !== "asset-groups" && level !== "ads") throw new CliError("UNKNOWN_COMMAND", `Unknown action: google results ${rawLevel}`, "Available: campaigns, ad-groups, asset-groups, ads, keywords, placements, search-terms");
|
|
3067
3076
|
if (unexpectedArgs.length > 0) throw new CliError("UNKNOWN_COMMAND", `Unknown argument after google results ${rawLevel}: ${unexpectedArgs.join(" ")}`, `Run: adkit manage google results ${level} --help`);
|
|
3068
3077
|
return level;
|
|
3069
3078
|
}
|
|
@@ -3074,11 +3083,13 @@ function inferGoogleResultsLevel(campaignId, adGroupId, explicitLevel) {
|
|
|
3074
3083
|
return void 0;
|
|
3075
3084
|
}
|
|
3076
3085
|
async function listGoogleResults(client, args, flags) {
|
|
3086
|
+
const requestedLevel = parseGoogleResultsLevelArg(args);
|
|
3087
|
+
if (requestedLevel === "asset-groups") return listGoogleAssetGroupResults(client, flags);
|
|
3077
3088
|
validateFlags(flags, GOOGLE_RESULTS_FLAGS, "manage google results");
|
|
3078
3089
|
const accountId = typeof flags.account === "string" ? flags.account : void 0;
|
|
3079
3090
|
const campaignId = typeof flags.campaign === "string" ? flags.campaign : void 0;
|
|
3080
3091
|
const adGroupId = typeof flags["ad-group"] === "string" ? flags["ad-group"] : void 0;
|
|
3081
|
-
const explicitLevel =
|
|
3092
|
+
const explicitLevel = requestedLevel;
|
|
3082
3093
|
const level = inferGoogleResultsLevel(campaignId, adGroupId, explicitLevel);
|
|
3083
3094
|
const period = typeof flags.period === "string" ? flags.period : void 0;
|
|
3084
3095
|
const from = typeof flags.from === "string" ? flags.from : void 0;
|
|
@@ -3095,6 +3106,19 @@ async function listGoogleResults(client, args, flags) {
|
|
|
3095
3106
|
const qs = queryString({ accountId, level, campaignId, adGroupId, period, from, to, sort, limit, status: status2, breakdown, fields, conversionActions, raw });
|
|
3096
3107
|
return client.get(`/manage/google/results${qs}`);
|
|
3097
3108
|
}
|
|
3109
|
+
async function listGoogleAssetGroupResults(client, flags) {
|
|
3110
|
+
validateFlags(flags, ["campaign", "asset-group", "period", "from", "to", "sort", "sort-direction", "limit", "offset", "status", "breakdown", "fields", "raw"], "manage google results asset-groups");
|
|
3111
|
+
const mappings = { account: "accountId", campaign: "campaignIds", "asset-group": "assetGroupIds", period: "period", from: "from", to: "to", sort: "sort", "sort-direction": "sortDirection", limit: "limit", offset: "offset", status: "statuses", breakdown: "breakdowns", fields: "fields" };
|
|
3112
|
+
const params = { level: "asset-groups" };
|
|
3113
|
+
for (const [flag, param] of Object.entries(mappings)) {
|
|
3114
|
+
const value = flags[flag];
|
|
3115
|
+
if (typeof value === "string") params[param] = value;
|
|
3116
|
+
}
|
|
3117
|
+
if (flags.raw === true) params.raw = "true";
|
|
3118
|
+
if (typeof flags.fields === "string") delete flags.fields;
|
|
3119
|
+
const qs = queryString(params);
|
|
3120
|
+
return client.get(`/manage/google/results${qs}`);
|
|
3121
|
+
}
|
|
3098
3122
|
function buildSearchTermsQuery(flags) {
|
|
3099
3123
|
const accountId = typeof flags.account === "string" ? flags.account : void 0;
|
|
3100
3124
|
const campaignId = typeof flags.campaign === "string" ? flags.campaign : void 0;
|
|
@@ -5700,7 +5724,7 @@ var CLI_VERSION = require2("../package.json").version;
|
|
|
5700
5724
|
var DEFAULT_BASE_URL = "https://app.adkit.so/api/v1";
|
|
5701
5725
|
var GOOGLE_NUMERIC_ID_PATTERN2 = /^\d+$/;
|
|
5702
5726
|
var GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORY_LIST = GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORIES.join(", ");
|
|
5703
|
-
var GOOGLE_RESULTS_LEVEL_ACTIONS = /* @__PURE__ */ new Set(["campaigns", "ad-groups", "ads"]);
|
|
5727
|
+
var GOOGLE_RESULTS_LEVEL_ACTIONS = /* @__PURE__ */ new Set(["campaigns", "ad-groups", "asset-groups", "ads"]);
|
|
5704
5728
|
var TIKTOK_NUMERIC_ID_PATTERN = /^\d+$/;
|
|
5705
5729
|
var REDDIT_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
5706
5730
|
var LINKEDIN_ID_PATTERN = /[\d:_]/;
|
|
@@ -6406,6 +6430,7 @@ Flags (create):
|
|
|
6406
6430
|
--bid-strategy <s> manual_cpc, manual_cpm, maximize_clicks, maximize_conversions, maximize_conversion_value, target_spend, target_impression_share
|
|
6407
6431
|
--target-cpa <n> Target CPA in account currency (with --bid-strategy maximize_conversions)
|
|
6408
6432
|
--target-roas <n> Target ROAS ratio, e.g. 3.5 = 350% (with --bid-strategy maximize_conversion_value)
|
|
6433
|
+
--ai-max <true|false> AI Max master switch (Search only)
|
|
6409
6434
|
--conversion-goals <list> Comma-separated goal categories or conversion-action IDs; never mix them
|
|
6410
6435
|
|
|
6411
6436
|
Flags (update):
|
|
@@ -6415,6 +6440,7 @@ Flags (update):
|
|
|
6415
6440
|
--bid-strategy <s> Change bidding strategy
|
|
6416
6441
|
--target-cpa <n> Target CPA in account currency. Send alone to retune the existing maximize_conversions target
|
|
6417
6442
|
--target-roas <n> Target ROAS ratio (3.5 = 350%). Send alone to retune the existing target, incl. Performance Max
|
|
6443
|
+
--ai-max <true|false> Enable/disable AI Max (Search only); omit to leave unchanged
|
|
6418
6444
|
--conversion-goals <list> Replace goals; pass null to restore account defaults
|
|
6419
6445
|
--countries <codes> Replace included countries, e.g. US,CA
|
|
6420
6446
|
|
|
@@ -6424,7 +6450,10 @@ Flags (list):
|
|
|
6424
6450
|
--offset <n> Pagination offset
|
|
6425
6451
|
|
|
6426
6452
|
Note:
|
|
6427
|
-
list returns campaign configuration only (name, status, budget).
|
|
6453
|
+
list returns campaign configuration only (name, status, budget, aiMax when Google returns it).
|
|
6454
|
+
AI Max: --ai-max true or --data '{"aiMax":{"enabled":true}}'. This master switch does not opt in to text customization or Final URL expansion.
|
|
6455
|
+
Enabling expands search matching unless disabled on an ad group. Disabling stops all AI Max features, including previously enabled text customization.
|
|
6456
|
+
AI Max does not guarantee an AI Mode placement.
|
|
6428
6457
|
Geo targeting lives in targeting.geoLocations. For countries, use {"type":"country","country":"US"}.
|
|
6429
6458
|
Use --data to set match to "presence" or "presence_or_interest". AdKit uses presence on create; on update, omit match to keep the live value.
|
|
6430
6459
|
For cities, regions, postal codes, and metros, run google geo-locations search and use the returned bare code.
|
|
@@ -6464,6 +6493,7 @@ Flags (create):
|
|
|
6464
6493
|
--budget-daily <n> Daily budget in account currency
|
|
6465
6494
|
--campaign-type <type> search, display, demand_gen, performance_max (performance_max needs --data for asset groups)
|
|
6466
6495
|
--bid-strategy <s> manual_cpc, manual_cpm, maximize_clicks, maximize_conversions, maximize_conversion_value, target_spend, target_impression_share
|
|
6496
|
+
--ai-max <true|false> AI Max master switch (Search only)
|
|
6467
6497
|
--conversion-goals <list> Comma-separated goal categories or conversion-action IDs; never mix them
|
|
6468
6498
|
${FLAG.account}
|
|
6469
6499
|
${FLAG.publish}
|
|
@@ -6474,6 +6504,7 @@ Flags (update):
|
|
|
6474
6504
|
--status <s> enabled, paused
|
|
6475
6505
|
--budget-daily <n> Daily budget in account currency
|
|
6476
6506
|
--bid-strategy <s> Change bidding strategy
|
|
6507
|
+
--ai-max <true|false> Enable/disable AI Max (Search only); omit to leave unchanged
|
|
6477
6508
|
--conversion-goals <list> Replace goals; pass null to restore account defaults
|
|
6478
6509
|
--countries <codes> Replace included countries, e.g. US,CA
|
|
6479
6510
|
${FLAG.account}
|
|
@@ -6487,7 +6518,10 @@ Flags (list):
|
|
|
6487
6518
|
|
|
6488
6519
|
Notes:
|
|
6489
6520
|
Use google assets for explicit account/campaign/ad-group attachment, reusable libraries, or richer sitelinks via --data.
|
|
6490
|
-
list returns campaign configuration only (name, status, budget).
|
|
6521
|
+
list returns campaign configuration only (name, status, budget, aiMax when Google returns it).
|
|
6522
|
+
AI Max: --ai-max true or --data '{"aiMax":{"enabled":true}}'. This master switch does not opt in to text customization or Final URL expansion.
|
|
6523
|
+
Enabling expands search matching unless disabled on an ad group. Disabling stops all AI Max features, including previously enabled text customization.
|
|
6524
|
+
AI Max does not guarantee an AI Mode placement.
|
|
6491
6525
|
Geo targeting lives in targeting.geoLocations. For countries, use {"type":"country","country":"US"}.
|
|
6492
6526
|
Use --data to set match to "presence" or "presence_or_interest". AdKit uses presence on create; on update, match alone changes matching without replacing locations and omission keeps the live value.
|
|
6493
6527
|
platformLocation accepts exact Google geo objects for advanced criteria and existing raw values.
|
|
@@ -6524,6 +6558,10 @@ var GOOGLE_ASSET_GROUP_HELP = `adkit manage google asset-groups \u2014 Performan
|
|
|
6524
6558
|
delete <id> Delete by numeric Google asset group ID (platformId)
|
|
6525
6559
|
<id> View one group by numeric Google asset group ID (platformId)
|
|
6526
6560
|
|
|
6561
|
+
Flags (detail):
|
|
6562
|
+
--fields <list> Select detail fields, e.g. name,listingGroups. Omit for full detail.
|
|
6563
|
+
listingGroups is the configured include/exclude rule tree, not an expanded SKU inventory.
|
|
6564
|
+
|
|
6527
6565
|
Flags (list):
|
|
6528
6566
|
--campaign <id> Parent Performance Max campaign ID (required)
|
|
6529
6567
|
--limit <n> Max results
|
|
@@ -6922,6 +6960,7 @@ var GOOGLE_RESULTS_HELP = `adkit manage google results \u2014 Google Ads perform
|
|
|
6922
6960
|
[default] Account-wide or filtered performance metrics
|
|
6923
6961
|
campaigns One row per campaign
|
|
6924
6962
|
ad-groups One row per ad group
|
|
6963
|
+
asset-groups Performance Max asset-group reports
|
|
6925
6964
|
ads One row per ad
|
|
6926
6965
|
keywords Keyword-level spend, clicks, impressions per keyword
|
|
6927
6966
|
placements Placement report: websites, apps, and YouTube
|
|
@@ -6943,7 +6982,17 @@ Flags:
|
|
|
6943
6982
|
--raw Return raw Google API response
|
|
6944
6983
|
--account <id> Optional if one Google Ads account is connected
|
|
6945
6984
|
|
|
6946
|
-
|
|
6985
|
+
PMax asset-groups:
|
|
6986
|
+
Returns { report, rows, totals?, warnings? }; each row has entity, metrics and conversionEvents.
|
|
6987
|
+
Metrics: spend, conversions, conversionValue, costPerConversion (CPA), roas, clicks, impressions.
|
|
6988
|
+
Use --campaign <ids> and --asset-group <ids> (comma-separated), --period or --from/--to.
|
|
6989
|
+
--sort defaults to spend; --sort-direction asc|desc; --limit defaults to 1000; --offset for pages.
|
|
6990
|
+
--status active|paused|removed (comma-separated; omitted includes all); --breakdown day|device|network.
|
|
6991
|
+
--fields selects the metrics above. --raw adds provider fields inside each row, keeping the report envelope.
|
|
6992
|
+
Finite dates required; conversion-actions and legacy metric names are not supported at this level.
|
|
6993
|
+
Product rules: adkit manage google asset-groups <id> --fields listingGroups
|
|
6994
|
+
|
|
6995
|
+
Default metrics for other levels include:
|
|
6947
6996
|
Cost/clicks/conversions, CPA, CVR, ROAS, all conversions, view-through conversions,
|
|
6948
6997
|
top-position rates, search impression share where Google supports it, and serving/learning status.
|
|
6949
6998
|
|
|
@@ -6958,6 +7007,7 @@ Examples:
|
|
|
6958
7007
|
adkit manage google results
|
|
6959
7008
|
adkit manage google results campaigns --account 1234567890 --period 30d
|
|
6960
7009
|
adkit manage google results ad-groups --campaign 123 --period 30d
|
|
7010
|
+
adkit manage google results asset-groups --campaign 123 --period 30d
|
|
6961
7011
|
adkit manage google results ads --campaign 123 --period 30d
|
|
6962
7012
|
adkit manage google results keywords --account 1234567890 --period 7d
|
|
6963
7013
|
adkit manage google results --campaign 123 --period 7d
|
package/package.json
CHANGED