@adkit/cli 1.12.18 → 1.12.20
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 +38 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1815,8 +1815,8 @@ var ASSET_CREATE_FLAGS = ["type", "text", "sitelink", "header", "value", "descri
|
|
|
1815
1815
|
var ASSET_LINK_FLAGS = ["type", "scope", "scope-id", "status"];
|
|
1816
1816
|
var MEDIA_UPLOAD_FLAGS = ["file", "url", "base64", "adkit-media", "filename", "content-type", "name"];
|
|
1817
1817
|
var CAMPAIGN_LIST_FLAGS = ["status", "limit", "offset"];
|
|
1818
|
-
var CAMPAIGN_CREATE_FLAGS = ["name", "status", "budget-daily", "campaign-type", "bid-strategy", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1819
|
-
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1818
|
+
var CAMPAIGN_CREATE_FLAGS = ["name", "status", "budget-daily", "campaign-type", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1819
|
+
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1820
1820
|
var AD_GROUP_LIST_FLAGS = ["campaign", "status", "limit", "offset"];
|
|
1821
1821
|
var AD_GROUP_FLAGS = ["campaign", "name", "status", "cpc-bid"];
|
|
1822
1822
|
var AD_LIST_FLAGS = ["ad-group", "status", "policy-status", "limit", "offset"];
|
|
@@ -1831,9 +1831,9 @@ var NEGATIVE_LIST_LIST_FLAGS = ["status", "limit", "offset"];
|
|
|
1831
1831
|
var NEGATIVE_LIST_ATTACH_FLAGS = ["campaign"];
|
|
1832
1832
|
var SEARCH_TERMS_FLAGS = ["campaign", "ad-group", "keyword", "keyword-match-type", "period", "from", "to", "min-impressions", "sort", "limit", "raw"];
|
|
1833
1833
|
var PLACEMENT_REPORT_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "raw"];
|
|
1834
|
-
var GOOGLE_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "breakdown", "fields", "raw"];
|
|
1834
|
+
var GOOGLE_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "breakdown", "fields", "conversion-actions", "raw"];
|
|
1835
1835
|
var GOOGLE_KEYWORD_RESULTS_FLAGS = ["campaign", "ad-group", "period", "from", "to", "sort", "limit", "status", "fields", "raw"];
|
|
1836
|
-
var CHANGE_HISTORY_FLAGS = ["account", "period", "from", "to", "limit"];
|
|
1836
|
+
var CHANGE_HISTORY_FLAGS = ["account", "period", "from", "to", "limit", "resource", "campaign", "ad-group"];
|
|
1837
1837
|
var KEYWORD_RESEARCH_FLAGS = ["url", "location", "language", "limit", "min-volume"];
|
|
1838
1838
|
var TARGETING_RESEARCH_FLAGS = ["limit"];
|
|
1839
1839
|
function generateCampaignName2() {
|
|
@@ -1975,6 +1975,8 @@ function buildCampaignPayload2(flags) {
|
|
|
1975
1975
|
if (typeof flags["campaign-type"] === "string") payload.campaignType = flags["campaign-type"];
|
|
1976
1976
|
if (typeof flags["budget-daily"] === "string") payload.budget = { daily: Number.parseFloat(flags["budget-daily"]) };
|
|
1977
1977
|
if (typeof flags["bid-strategy"] === "string") payload.bidStrategy = flags["bid-strategy"];
|
|
1978
|
+
if (typeof flags["target-cpa"] === "string") payload.targetCpa = Number.parseFloat(flags["target-cpa"]);
|
|
1979
|
+
if (typeof flags["target-roas"] === "string") payload.targetRoas = Number.parseFloat(flags["target-roas"]);
|
|
1978
1980
|
if (flags["search-partners"] === true) payload.searchPartners = true;
|
|
1979
1981
|
if (flags["display-network"] === true) payload.displayNetwork = true;
|
|
1980
1982
|
if (typeof flags["tracking-url-suffix"] === "string") payload.trackingUrlSuffix = flags["tracking-url-suffix"];
|
|
@@ -1992,6 +1994,8 @@ function buildCampaignUpdatePayloadFromFlags(flags) {
|
|
|
1992
1994
|
if (typeof flags.status === "string") payload.status = flags.status;
|
|
1993
1995
|
if (typeof flags["budget-daily"] === "string") payload.budget = { daily: Number.parseFloat(flags["budget-daily"]) };
|
|
1994
1996
|
if (typeof flags["bid-strategy"] === "string") payload.bidStrategy = flags["bid-strategy"];
|
|
1997
|
+
if (typeof flags["target-cpa"] === "string") payload.targetCpa = Number.parseFloat(flags["target-cpa"]);
|
|
1998
|
+
if (typeof flags["target-roas"] === "string") payload.targetRoas = Number.parseFloat(flags["target-roas"]);
|
|
1995
1999
|
if (flags["search-partners"] === true) payload.searchPartners = true;
|
|
1996
2000
|
if (flags["display-network"] === true) payload.displayNetwork = true;
|
|
1997
2001
|
if (typeof flags["tracking-url-suffix"] === "string") payload.trackingUrlSuffix = flags["tracking-url-suffix"];
|
|
@@ -2623,8 +2627,9 @@ async function listGoogleResults(client, args, flags) {
|
|
|
2623
2627
|
const fieldsFlag = typeof flags.fields === "string" ? flags.fields.trim() : "";
|
|
2624
2628
|
const fields = fieldsFlag ? fieldsFlag : void 0;
|
|
2625
2629
|
if (typeof flags.fields === "string") delete flags.fields;
|
|
2630
|
+
const conversionActions = flags["conversion-actions"] === true ? "true" : void 0;
|
|
2626
2631
|
const raw = flags.raw === true ? "true" : void 0;
|
|
2627
|
-
const qs = queryString({ accountId, level, campaignId, adGroupId, period, from, to, sort, limit, status: status2, breakdown, fields, raw });
|
|
2632
|
+
const qs = queryString({ accountId, level, campaignId, adGroupId, period, from, to, sort, limit, status: status2, breakdown, fields, conversionActions, raw });
|
|
2628
2633
|
return client.get(`/manage/google/results${qs}`);
|
|
2629
2634
|
}
|
|
2630
2635
|
function buildSearchTermsQuery(flags) {
|
|
@@ -2670,7 +2675,10 @@ async function listGoogleChangeHistory(client, _args, flags) {
|
|
|
2670
2675
|
const period = typeof flags.period === "string" ? flags.period : void 0;
|
|
2671
2676
|
const from = typeof flags.from === "string" ? flags.from : void 0;
|
|
2672
2677
|
const to = typeof flags.to === "string" ? flags.to : void 0;
|
|
2673
|
-
const
|
|
2678
|
+
const resource = typeof flags.resource === "string" ? flags.resource : void 0;
|
|
2679
|
+
const campaignId = typeof flags.campaign === "string" ? flags.campaign : void 0;
|
|
2680
|
+
const adGroupId = typeof flags["ad-group"] === "string" ? flags["ad-group"] : void 0;
|
|
2681
|
+
const qs = buildGoogleListQuery(flags, { period, from, to, resource, campaignId, adGroupId });
|
|
2674
2682
|
const path3 = `/manage/google/change-history${qs}`;
|
|
2675
2683
|
return client.get(path3);
|
|
2676
2684
|
}
|
|
@@ -4044,6 +4052,10 @@ var FLAG = {
|
|
|
4044
4052
|
budgetDaily: " --budget-daily <n> Daily budget in account currency",
|
|
4045
4053
|
cta: " --cta <type> sign_up, learn_more, shop_now, download, get_offer, contact_us, subscribe, get_quote, book_now, apply_now"
|
|
4046
4054
|
};
|
|
4055
|
+
var RAW_PLATFORM_LABELS = { google: "Google", meta: "Meta", reddit: "Reddit", tiktok: "TikTok" };
|
|
4056
|
+
function rawPlatformCommandLine(platform2) {
|
|
4057
|
+
return `Raw ${RAW_PLATFORM_LABELS[platform2] ?? platform2} API calls use the shared command: adkit manage platform-api-requests --platform ${platform2} ...`;
|
|
4058
|
+
}
|
|
4047
4059
|
var CAMPAIGN_HELP = `adkit manage meta campaigns \u2014 Meta ad campaigns
|
|
4048
4060
|
|
|
4049
4061
|
list List campaigns
|
|
@@ -4667,12 +4679,16 @@ Flags (create):
|
|
|
4667
4679
|
--budget-daily <n> Daily budget in account currency
|
|
4668
4680
|
--campaign-type <type> search, display, performance_max (performance_max needs --data for asset groups)
|
|
4669
4681
|
--bid-strategy <s> manual_cpc, manual_cpm, maximize_clicks, maximize_conversions, maximize_conversion_value, target_spend, target_impression_share
|
|
4682
|
+
--target-cpa <n> Target CPA in account currency (with --bid-strategy maximize_conversions)
|
|
4683
|
+
--target-roas <n> Target ROAS ratio, e.g. 3.5 = 350% (with --bid-strategy maximize_conversion_value)
|
|
4670
4684
|
|
|
4671
4685
|
Flags (update):
|
|
4672
4686
|
--name <name> Campaign name
|
|
4673
4687
|
--status <s> enabled, paused
|
|
4674
4688
|
--budget-daily <n> Daily budget in account currency
|
|
4675
4689
|
--bid-strategy <s> Change bidding strategy
|
|
4690
|
+
--target-cpa <n> Target CPA in account currency. Send alone to retune the existing maximize_conversions target
|
|
4691
|
+
--target-roas <n> Target ROAS ratio (3.5 = 350%). Send alone to retune the existing target, incl. Performance Max
|
|
4676
4692
|
--countries <codes> Replace included countries, e.g. US,CA
|
|
4677
4693
|
|
|
4678
4694
|
Flags (list):
|
|
@@ -5095,6 +5111,8 @@ Flags:
|
|
|
5095
5111
|
--status <s> Filter: enabled, paused, all
|
|
5096
5112
|
--breakdown <b> Split rows by: day, device, network, hour, geo. Hour/geo support account, campaigns, ad-groups.
|
|
5097
5113
|
--fields <list> Response fields, e.g. cost,clicks,searchImpressionShare. Omit for default advertiser metrics; use all for every supported field.
|
|
5114
|
+
--conversion-actions
|
|
5115
|
+
Add conversionEvents per row, grouped by Google conversion action. Costs one extra Google read call.
|
|
5098
5116
|
--raw Return raw Google API response
|
|
5099
5117
|
--account <id> Optional if one Google Ads account is connected
|
|
5100
5118
|
|
|
@@ -5118,6 +5136,7 @@ Examples:
|
|
|
5118
5136
|
adkit manage google results --campaign 123 --period 7d
|
|
5119
5137
|
adkit manage google results --campaign 123 --period 7d --breakdown day
|
|
5120
5138
|
adkit manage google results --campaign 123 --period 7d --breakdown device
|
|
5139
|
+
adkit manage google results campaigns --period 30d --conversion-actions
|
|
5121
5140
|
adkit manage google results campaigns --period 7d --breakdown hour
|
|
5122
5141
|
adkit manage google results campaigns --period 30d --breakdown geo
|
|
5123
5142
|
adkit manage google results placements --campaign 123 --period 30d
|
|
@@ -5137,6 +5156,9 @@ Flags:
|
|
|
5137
5156
|
--from <date> Start date (YYYY-MM-DD, requires --to). Window must be <= 30 days and within the last 30 days.
|
|
5138
5157
|
--to <date> End date (YYYY-MM-DD, requires --from)
|
|
5139
5158
|
--limit <n> Max changes (default: 50, max: 10000)
|
|
5159
|
+
--resource <type> campaign | ad-group | ad | keyword
|
|
5160
|
+
--campaign <id> Filter to changes affecting one campaign
|
|
5161
|
+
--ad-group <id> Filter to changes affecting one ad group
|
|
5140
5162
|
|
|
5141
5163
|
Each record:
|
|
5142
5164
|
time, resourceType, resourceName, operation (create | update | remove),
|
|
@@ -5148,6 +5170,8 @@ Note:
|
|
|
5148
5170
|
|
|
5149
5171
|
Examples:
|
|
5150
5172
|
adkit manage google change-history list --period 7d
|
|
5173
|
+
adkit manage google change-history list --period 7d --resource campaign
|
|
5174
|
+
adkit manage google change-history list --period 7d --campaign 123456789
|
|
5151
5175
|
adkit manage google change-history list --period 30d --limit 200
|
|
5152
5176
|
adkit manage google change-history list --from 2026-06-01 --to 2026-06-15`;
|
|
5153
5177
|
var GOOGLE_RESULTS_PLACEMENTS_HELP = `adkit manage google results placements \u2014 Google placement report
|
|
@@ -5569,6 +5593,7 @@ ${FLAG.publish}
|
|
|
5569
5593
|
${FLAG.data}
|
|
5570
5594
|
|
|
5571
5595
|
Mutations are draft-first by default. Use --publish to publish immediately.
|
|
5596
|
+
${rawPlatformCommandLine("meta")}
|
|
5572
5597
|
Run adkit manage meta <group> --help for details.`.trim(),
|
|
5573
5598
|
google: `adkit manage google \u2014 Google Ads management
|
|
5574
5599
|
|
|
@@ -5591,6 +5616,7 @@ ${FLAG.publish}
|
|
|
5591
5616
|
${FLAG.data}
|
|
5592
5617
|
|
|
5593
5618
|
Mutations are draft-first by default. Use --publish to publish immediately.
|
|
5619
|
+
${rawPlatformCommandLine("google")}
|
|
5594
5620
|
Display path: research topics/interests, upload images with google media, create campaigns --campaign-type display, create ad-groups with targeting, then create ads with type:"responsive_display".
|
|
5595
5621
|
Google Display Ads is in beta \u2014 some first-class normalized Display features may not be available yet.
|
|
5596
5622
|
Run adkit manage google <group> --help for details.`.trim(),
|
|
@@ -5609,14 +5635,14 @@ ${FLAG.account}
|
|
|
5609
5635
|
${FLAG.publish}
|
|
5610
5636
|
${FLAG.data}
|
|
5611
5637
|
|
|
5638
|
+
${rawPlatformCommandLine("tiktok")}
|
|
5612
5639
|
Run adkit manage tiktok <group> --help for details.`.trim(),
|
|
5613
5640
|
reddit: `adkit manage reddit \u2014 Reddit Ads management
|
|
5614
5641
|
|
|
5615
5642
|
Entity groups:
|
|
5616
5643
|
accounts List and connect Reddit ad accounts
|
|
5617
5644
|
|
|
5618
|
-
|
|
5619
|
-
adkit manage platform-api-requests --platform reddit ...
|
|
5645
|
+
${rawPlatformCommandLine("reddit")}
|
|
5620
5646
|
|
|
5621
5647
|
General flags:
|
|
5622
5648
|
${FLAG.account}
|
|
@@ -6098,9 +6124,12 @@ ${titleParts.join(" \xB7 ")}`);
|
|
|
6098
6124
|
const parts = [];
|
|
6099
6125
|
const count = num(val, "count");
|
|
6100
6126
|
const cost = num(val, "costPerResult") ?? num(val, "cost");
|
|
6127
|
+
const label = str(val, "label") ?? humanizeAction(key);
|
|
6101
6128
|
if (count !== void 0) parts.push(fmtNum(count));
|
|
6102
6129
|
if (cost !== void 0) parts.push(`${fmtCurrency(cost, currency)} each`);
|
|
6103
|
-
|
|
6130
|
+
const labelColumn = label.padEnd(14);
|
|
6131
|
+
const metricText = parts.join(" \xB7 ");
|
|
6132
|
+
if (parts.length > 0) console.log(` ${labelColumn}${metricText}`);
|
|
6104
6133
|
}
|
|
6105
6134
|
}
|
|
6106
6135
|
const aq = nested(row, "ad_quality");
|
package/package.json
CHANGED