@adkit/cli 1.13.21 → 1.13.23
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 +106 -33
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// ../shared/dist/errors.js
|
|
4
|
+
function describeRetryDelay(retryAfterSeconds) {
|
|
5
|
+
if (!retryAfterSeconds || retryAfterSeconds <= 300)
|
|
6
|
+
return "in a few minutes";
|
|
7
|
+
if (retryAfterSeconds <= 3600)
|
|
8
|
+
return "within the hour";
|
|
9
|
+
return "in a few hours";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// ../shared/dist/utils/type-guards.js
|
|
13
|
+
function isPlainObject(value) {
|
|
14
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15
|
+
}
|
|
16
|
+
function readProperty(value, key) {
|
|
17
|
+
return value[key];
|
|
18
|
+
}
|
|
19
|
+
function readStringProperty(value, key) {
|
|
20
|
+
const raw = value[key];
|
|
21
|
+
return typeof raw === "string" ? raw : void 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ../shared/dist/manage/google/constants.js
|
|
25
|
+
var GOOGLE_LIMITED_AD_APPROVAL_STATUSES = ["APPROVED_LIMITED", "AREA_OF_INTEREST_ONLY"];
|
|
26
|
+
var GOOGLE_PROBLEM_AD_APPROVAL_STATUSES = ["DISAPPROVED", ...GOOGLE_LIMITED_AD_APPROVAL_STATUSES];
|
|
27
|
+
|
|
28
|
+
// ../shared/dist/manage/google/campaign-validation.js
|
|
29
|
+
var VALID_GOOGLE_BID_STRATEGIES = ["manual_cpc", "manual_cpm", "maximize_clicks", "maximize_conversions", "maximize_conversion_value", "target_spend", "target_impression_share"];
|
|
30
|
+
var SUPPORTED_GOOGLE_CAMPAIGN_TYPES = ["search", "display"];
|
|
31
|
+
var validGoogleBidStrategySet = new Set(VALID_GOOGLE_BID_STRATEGIES);
|
|
32
|
+
var validGoogleBidStrategyList = VALID_GOOGLE_BID_STRATEGIES.join(", ");
|
|
33
|
+
var supportedGoogleCampaignTypeSet = new Set(SUPPORTED_GOOGLE_CAMPAIGN_TYPES);
|
|
34
|
+
var supportedGoogleCampaignTypeList = SUPPORTED_GOOGLE_CAMPAIGN_TYPES.join(", ");
|
|
35
|
+
|
|
36
|
+
// ../shared/dist/manage/google/validators/conversion-goals.js
|
|
37
|
+
var GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORIES = [
|
|
38
|
+
"add_to_cart",
|
|
39
|
+
"begin_checkout",
|
|
40
|
+
"book_appointment",
|
|
41
|
+
"contact",
|
|
42
|
+
"converted_lead",
|
|
43
|
+
"default",
|
|
44
|
+
"download",
|
|
45
|
+
"engagement",
|
|
46
|
+
"get_directions",
|
|
47
|
+
"imported_lead",
|
|
48
|
+
"outbound_click",
|
|
49
|
+
"page_view",
|
|
50
|
+
"phone_call_lead",
|
|
51
|
+
"purchase",
|
|
52
|
+
"qualified_lead",
|
|
53
|
+
"request_quote",
|
|
54
|
+
"signup",
|
|
55
|
+
"store_sale",
|
|
56
|
+
"store_visit",
|
|
57
|
+
"submit_lead_form",
|
|
58
|
+
"subscribe_paid",
|
|
59
|
+
"youtube_follow_on_views"
|
|
60
|
+
];
|
|
61
|
+
var googleCampaignConversionGoalCategorySet = new Set(GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORIES);
|
|
62
|
+
|
|
63
|
+
// ../shared/dist/manage/google/types/google-adkit.js
|
|
64
|
+
var GOOGLE_GEO_LOCATION_SEARCH_TYPES = ["country", "region", "city", "postal_code", "metro"];
|
|
65
|
+
|
|
3
66
|
// src/config.ts
|
|
4
67
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
5
68
|
import { join } from "node:path";
|
|
@@ -65,15 +128,6 @@ function readLegacyProjectApiKey(config, selectedProject) {
|
|
|
65
128
|
return config.projects?.[selectedProject]?.apiKey ?? null;
|
|
66
129
|
}
|
|
67
130
|
|
|
68
|
-
// ../shared/dist/errors.js
|
|
69
|
-
function describeRetryDelay(retryAfterSeconds) {
|
|
70
|
-
if (!retryAfterSeconds || retryAfterSeconds <= 300)
|
|
71
|
-
return "in a few minutes";
|
|
72
|
-
if (retryAfterSeconds <= 3600)
|
|
73
|
-
return "within the hour";
|
|
74
|
-
return "in a few hours";
|
|
75
|
-
}
|
|
76
|
-
|
|
77
131
|
// src/errors.ts
|
|
78
132
|
var CliError = class extends Error {
|
|
79
133
|
code;
|
|
@@ -528,10 +582,15 @@ var isWsl = () => {
|
|
|
528
582
|
return true;
|
|
529
583
|
}
|
|
530
584
|
try {
|
|
531
|
-
|
|
585
|
+
if (fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
|
|
586
|
+
return !isInsideContainer();
|
|
587
|
+
}
|
|
532
588
|
} catch {
|
|
533
|
-
return false;
|
|
534
589
|
}
|
|
590
|
+
if (fs3.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs3.existsSync("/run/WSL")) {
|
|
591
|
+
return !isInsideContainer();
|
|
592
|
+
}
|
|
593
|
+
return false;
|
|
535
594
|
};
|
|
536
595
|
var is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
537
596
|
|
|
@@ -1748,9 +1807,6 @@ function getAd(client, args, flags) {
|
|
|
1748
1807
|
return getMetaEntity(client, args, flags, { path: "ads", usageHint: "Run: adkit manage meta ads <ad-id>" });
|
|
1749
1808
|
}
|
|
1750
1809
|
|
|
1751
|
-
// ../shared/dist/manage/google/types/google-adkit.js
|
|
1752
|
-
var GOOGLE_GEO_LOCATION_SEARCH_TYPES = ["country", "region", "city", "postal_code", "metro"];
|
|
1753
|
-
|
|
1754
1810
|
// ../shared/dist/manage/google/asset-utils.js
|
|
1755
1811
|
var SUPPORTED_GOOGLE_STRUCTURED_SNIPPET_HEADERS = ["Amenities", "Brands", "Courses", "Degree programs", "Destinations", "Featured hotels", "Insurance coverage", "Models", "Neighborhoods", "Service catalog", "Shows", "Styles", "Types"];
|
|
1756
1812
|
var STRUCTURED_SNIPPET_HEADER_LOOKUP = new Map(SUPPORTED_GOOGLE_STRUCTURED_SNIPPET_HEADERS.map((header) => [header.toLowerCase(), header]));
|
|
@@ -1919,18 +1975,6 @@ function parseGoogleSitelinkShorthand(value) {
|
|
|
1919
1975
|
return normalizeSitelinkAsset({ type: "sitelink", linkText, finalUrls: [finalUrl] });
|
|
1920
1976
|
}
|
|
1921
1977
|
|
|
1922
|
-
// ../shared/dist/utils/type-guards.js
|
|
1923
|
-
function isPlainObject(value) {
|
|
1924
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1925
|
-
}
|
|
1926
|
-
function readProperty(value, key) {
|
|
1927
|
-
return value[key];
|
|
1928
|
-
}
|
|
1929
|
-
function readStringProperty(value, key) {
|
|
1930
|
-
const raw = value[key];
|
|
1931
|
-
return typeof raw === "string" ? raw : void 0;
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
1978
|
// src/commands/google.ts
|
|
1935
1979
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
1936
1980
|
import { basename, extname, resolve } from "node:path";
|
|
@@ -1940,8 +1984,8 @@ var ASSET_CREATE_FLAGS = ["type", "text", "sitelink", "header", "value", "descri
|
|
|
1940
1984
|
var ASSET_LINK_FLAGS = ["type", "scope", "scope-id", "status"];
|
|
1941
1985
|
var MEDIA_UPLOAD_FLAGS = ["file", "url", "base64", "adkit-media", "video-id", "filename", "content-type", "name"];
|
|
1942
1986
|
var CAMPAIGN_LIST_FLAGS = ["status", "limit", "offset"];
|
|
1943
|
-
var CAMPAIGN_CREATE_FLAGS = ["name", "status", "budget-daily", "campaign-type", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1944
|
-
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1987
|
+
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"];
|
|
1988
|
+
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "conversion-goals", "countries"];
|
|
1945
1989
|
var ASSET_GROUP_LIST_FLAGS = ["campaign", "limit", "offset"];
|
|
1946
1990
|
var ASSET_GROUP_CREATE_FLAGS = ["campaign", "name", "status", "final-url"];
|
|
1947
1991
|
var ASSET_GROUP_UPDATE_FLAGS = ["name", "status", "final-url"];
|
|
@@ -2206,6 +2250,7 @@ function buildCampaignPayload2(flags) {
|
|
|
2206
2250
|
if (flags["search-partners"] === true) payload.searchPartners = true;
|
|
2207
2251
|
if (flags["display-network"] === true) payload.displayNetwork = true;
|
|
2208
2252
|
if (typeof flags["tracking-url-suffix"] === "string") payload.trackingUrlSuffix = flags["tracking-url-suffix"];
|
|
2253
|
+
if (typeof flags["conversion-goals"] === "string") payload.conversionGoals = parseCampaignConversionGoals(flags["conversion-goals"]);
|
|
2209
2254
|
if (typeof flags.countries === "string") payload.countries = parseCampaignCountries(flags.countries);
|
|
2210
2255
|
return payload;
|
|
2211
2256
|
}
|
|
@@ -2214,6 +2259,12 @@ function parseCampaignCountries(value) {
|
|
|
2214
2259
|
const normalizedCountries = countryParts.map((country) => country.trim().toUpperCase());
|
|
2215
2260
|
return normalizedCountries.filter(Boolean);
|
|
2216
2261
|
}
|
|
2262
|
+
function parseCampaignConversionGoals(value) {
|
|
2263
|
+
if (value.trim().toLowerCase() === "null") return null;
|
|
2264
|
+
const goalParts = value.split(",");
|
|
2265
|
+
const normalizedGoals = goalParts.map((goal) => goal.trim());
|
|
2266
|
+
return normalizedGoals.filter(Boolean);
|
|
2267
|
+
}
|
|
2217
2268
|
function buildCampaignUpdatePayloadFromFlags(flags) {
|
|
2218
2269
|
const payload = {};
|
|
2219
2270
|
if (typeof flags.name === "string") payload.name = flags.name;
|
|
@@ -2225,6 +2276,7 @@ function buildCampaignUpdatePayloadFromFlags(flags) {
|
|
|
2225
2276
|
if (flags["search-partners"] === true) payload.searchPartners = true;
|
|
2226
2277
|
if (flags["display-network"] === true) payload.displayNetwork = true;
|
|
2227
2278
|
if (typeof flags["tracking-url-suffix"] === "string") payload.trackingUrlSuffix = flags["tracking-url-suffix"];
|
|
2279
|
+
if (typeof flags["conversion-goals"] === "string") payload.conversionGoals = parseCampaignConversionGoals(flags["conversion-goals"]);
|
|
2228
2280
|
if (typeof flags.countries === "string") {
|
|
2229
2281
|
const countries = parseCampaignCountries(flags.countries);
|
|
2230
2282
|
payload.targeting = {
|
|
@@ -4755,6 +4807,7 @@ var require2 = createRequire(import.meta.url);
|
|
|
4755
4807
|
var CLI_VERSION = require2("../package.json").version;
|
|
4756
4808
|
var DEFAULT_BASE_URL = "https://app.adkit.so/api/v1";
|
|
4757
4809
|
var GOOGLE_NUMERIC_ID_PATTERN2 = /^\d+$/;
|
|
4810
|
+
var GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORY_LIST = GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORIES.join(", ");
|
|
4758
4811
|
var GOOGLE_RESULTS_LEVEL_ACTIONS = /* @__PURE__ */ new Set(["campaigns", "ad-groups", "ads"]);
|
|
4759
4812
|
var TIKTOK_NUMERIC_ID_PATTERN = /^\d+$/;
|
|
4760
4813
|
var LINKEDIN_ID_PATTERN = /[\d:_]/;
|
|
@@ -5435,6 +5488,7 @@ Flags (create):
|
|
|
5435
5488
|
--bid-strategy <s> manual_cpc, manual_cpm, maximize_clicks, maximize_conversions, maximize_conversion_value, target_spend, target_impression_share
|
|
5436
5489
|
--target-cpa <n> Target CPA in account currency (with --bid-strategy maximize_conversions)
|
|
5437
5490
|
--target-roas <n> Target ROAS ratio, e.g. 3.5 = 350% (with --bid-strategy maximize_conversion_value)
|
|
5491
|
+
--conversion-goals <list> Comma-separated goal categories or conversion-action IDs; never mix them
|
|
5438
5492
|
|
|
5439
5493
|
Flags (update):
|
|
5440
5494
|
--name <name> Campaign name
|
|
@@ -5443,6 +5497,7 @@ Flags (update):
|
|
|
5443
5497
|
--bid-strategy <s> Change bidding strategy
|
|
5444
5498
|
--target-cpa <n> Target CPA in account currency. Send alone to retune the existing maximize_conversions target
|
|
5445
5499
|
--target-roas <n> Target ROAS ratio (3.5 = 350%). Send alone to retune the existing target, incl. Performance Max
|
|
5500
|
+
--conversion-goals <list> Replace goals; pass null to restore account defaults
|
|
5446
5501
|
--countries <codes> Replace included countries, e.g. US,CA
|
|
5447
5502
|
|
|
5448
5503
|
Flags (list):
|
|
@@ -5458,15 +5513,20 @@ Note:
|
|
|
5458
5513
|
Advanced geo examples: adkit manage google campaigns --help full
|
|
5459
5514
|
Display creation starts here: campaigns create --campaign-type display, then create Display ad groups and responsive_display ads.
|
|
5460
5515
|
Performance Max: campaignType "performance_max" with asset groups \u2014 build it with --data. See --help full.
|
|
5516
|
+
conversion-goals chooses what to optimize toward; bid-strategy controls bidding. It works on Search, Display, and Performance Max.
|
|
5517
|
+
On create, omit conversion-goals to inherit account defaults. On update, omit it to leave goals unchanged or pass null to restore defaults.
|
|
5518
|
+
Run --help full for valid goal categories and conversion-action ID discovery.
|
|
5461
5519
|
View a Performance Max campaign by ID to read back its assetGroups; manage existing groups with google asset-groups.
|
|
5462
5520
|
For spend/clicks/conversions: adkit manage google results
|
|
5463
5521
|
|
|
5464
5522
|
Examples:
|
|
5465
5523
|
adkit manage google campaigns list --account 1234567890
|
|
5466
5524
|
adkit manage google campaigns create --name "Display Prospecting" --campaign-type display --budget-daily 50 --account 1234567890
|
|
5525
|
+
adkit manage google campaigns create --name "Purchase Search" --campaign-type search --budget-daily 40 --bid-strategy maximize_conversion_value --conversion-goals purchase --account 1234567890
|
|
5467
5526
|
adkit manage google campaigns create --data '{"campaigns":[{"name":"Display US","campaignType":"display","budget":{"daily":50},"targeting":{"geoLocations":{"include":[{"type":"country","country":"US"}]}}}]}' --account 1234567890
|
|
5468
5527
|
adkit manage google campaigns update 987654321 --data '{"targeting":{"geoLocations":{"match":"presence_or_interest"}}}' --account 1234567890
|
|
5469
5528
|
adkit manage google campaigns update 987654321 --status paused --account 1234567890
|
|
5529
|
+
adkit manage google campaigns update 987654321 --conversion-goals null --account 1234567890
|
|
5470
5530
|
adkit manage google campaigns delete 987654321 --account 1234567890
|
|
5471
5531
|
|
|
5472
5532
|
Run --help full for all fields and advanced options.`;
|
|
@@ -5484,6 +5544,7 @@ Flags (create):
|
|
|
5484
5544
|
--budget-daily <n> Daily budget in account currency
|
|
5485
5545
|
--campaign-type <type> search, display, performance_max (performance_max needs --data for asset groups)
|
|
5486
5546
|
--bid-strategy <s> manual_cpc, manual_cpm, maximize_clicks, maximize_conversions, maximize_conversion_value, target_spend, target_impression_share
|
|
5547
|
+
--conversion-goals <list> Comma-separated goal categories or conversion-action IDs; never mix them
|
|
5487
5548
|
${FLAG.account}
|
|
5488
5549
|
${FLAG.publish}
|
|
5489
5550
|
${FLAG.data}
|
|
@@ -5493,6 +5554,7 @@ Flags (update):
|
|
|
5493
5554
|
--status <s> enabled, paused
|
|
5494
5555
|
--budget-daily <n> Daily budget in account currency
|
|
5495
5556
|
--bid-strategy <s> Change bidding strategy
|
|
5557
|
+
--conversion-goals <list> Replace goals; pass null to restore account defaults
|
|
5496
5558
|
--countries <codes> Replace included countries, e.g. US,CA
|
|
5497
5559
|
${FLAG.account}
|
|
5498
5560
|
${FLAG.publish}
|
|
@@ -5512,17 +5574,24 @@ Notes:
|
|
|
5512
5574
|
Google exclusions support named locations. Proximity circles belong in include.
|
|
5513
5575
|
Display campaign creation uses campaignType:"display" or --campaign-type display. Videos are not supported for Display media in v1.
|
|
5514
5576
|
Performance Max: campaignType "performance_max" requires at least one assetGroups[] entry and supports multiple groups. Text assets are inline ({role,text}); upload images with google media first, then reference their id/resourceName. Needs an enabled conversion (publish is blocked without one). Non-retail only. Build it with --data.
|
|
5577
|
+
conversion-goals works on Search, Display, and Performance Max. It chooses what to optimize toward; bid-strategy controls bidding.
|
|
5578
|
+
Valid goal categories: ${GOOGLE_CAMPAIGN_CONVERSION_GOAL_CATEGORY_LIST}
|
|
5579
|
+
For exact IDs, run google conversions list and pass conversion.platformId. Do not pass conversion.category; it uses a different vocabulary.
|
|
5580
|
+
On create, omit conversion-goals to inherit account defaults. On update, omit it to leave goals unchanged or pass null to restore defaults.
|
|
5515
5581
|
View a Performance Max campaign by ID to read back its assetGroups. After creation, manage groups with google asset-groups.
|
|
5516
5582
|
For spend/clicks/conversions: adkit manage google results
|
|
5517
5583
|
|
|
5518
5584
|
Examples:
|
|
5519
5585
|
adkit manage google campaigns list --account 1234567890
|
|
5520
5586
|
adkit manage google campaigns create --name "Display Prospecting" --campaign-type display --budget-daily 50 --account 1234567890
|
|
5587
|
+
adkit manage google campaigns create --name "Purchase Search" --campaign-type search --budget-daily 40 --bid-strategy maximize_conversion_value --conversion-goals purchase --account 1234567890
|
|
5521
5588
|
adkit manage google campaigns create --data '{"campaigns":[{"name":"Display US","campaignType":"display","budget":{"daily":50},"targeting":{"geoLocations":{"include":[{"type":"country","country":"US"}]}}}]}' --account 1234567890
|
|
5522
5589
|
adkit manage google campaigns create --data '{"campaigns":[{"name":"Austin Search","campaignType":"search","budget":{"daily":5},"targeting":{"geoLocations":{"include":[{"type":"city","code":"1026201"}]}}}]}' --account 1234567890
|
|
5523
5590
|
adkit manage google campaigns create --data '{"campaigns":[{"name":"SF Radius","campaignType":"search","budget":{"daily":5},"targeting":{"geoLocations":{"include":[{"type":"platformLocation","platform":"google","value":{"proximity":{"geo_point":{"latitude_in_micro_degrees":37774900,"longitude_in_micro_degrees":-122419400},"radius":5,"radius_units":"MILES"}}}]}}}]}' --account 1234567890
|
|
5524
5591
|
adkit manage google campaigns create --data '{"campaigns":[{"name":"PMAX Launch","campaignType":"performance_max","budget":{"daily":50},"bidStrategy":"maximize_conversions","assetGroups":[{"name":"Asset Group 1","finalUrls":["https://example.com"],"assets":[{"role":"headline","text":"Ship faster"},{"role":"headline","text":"Save hours every week"},{"role":"headline","text":"Start free today"},{"role":"long_headline","text":"Automate your ad workflow and launch in minutes"},{"role":"description","text":"Automate your workflow in minutes"},{"role":"description","text":"No credit card required"},{"role":"business_name","text":"Acme"},{"role":"logo","id":"<uploaded-asset-id>"},{"role":"marketing_image","id":"<uploaded-asset-id>"},{"role":"square_marketing_image","id":"<uploaded-asset-id>"}],"signals":[{"type":"search_theme","text":"project management software"}]}]}]}' --account 1234567890
|
|
5525
5592
|
adkit manage google campaigns update 987654321 --status paused --account 1234567890
|
|
5593
|
+
adkit manage google campaigns update 987654321 --conversion-goals 23854890221234567 --account 1234567890
|
|
5594
|
+
adkit manage google campaigns update 987654321 --conversion-goals null --account 1234567890
|
|
5526
5595
|
adkit manage google campaigns update 987654321 --data '{"targeting":{"geoLocations":{"match":"presence_or_interest"}}}' --account 1234567890
|
|
5527
5596
|
adkit manage google campaigns delete 987654321 --account 1234567890 --publish`;
|
|
5528
5597
|
var GOOGLE_ASSET_GROUP_HELP = `adkit manage google asset-groups \u2014 Performance Max asset groups
|
|
@@ -6417,11 +6486,12 @@ ${FLAG.data}
|
|
|
6417
6486
|
--offset <n> Row offset for list
|
|
6418
6487
|
--campaign-ids <ids> Comma-separated campaign IDs for filtered reads
|
|
6419
6488
|
--name <name> Campaign name
|
|
6420
|
-
--status <s> create: active or draft (defaults to
|
|
6489
|
+
--status <s> create: active or draft (defaults to active). update: active, paused, or archived
|
|
6421
6490
|
--budget-lifetime <n> Lifetime budget in account currency
|
|
6422
6491
|
--end-date <date> YYYY-MM-DD; required with --budget-lifetime
|
|
6423
6492
|
|
|
6424
6493
|
Notes:
|
|
6494
|
+
Creates are saved as AdKit drafts unless --publish is set. The create status controls the LinkedIn state after publishing.
|
|
6425
6495
|
This tier takes lifetime budgets only; a daily budget here returns a 500. Set daily budgets on ad-groups.
|
|
6426
6496
|
A live campaign can never go back to draft.
|
|
6427
6497
|
|
|
@@ -6452,7 +6522,7 @@ ${FLAG.data}
|
|
|
6452
6522
|
--campaign <id> Parent campaign ID (create only)
|
|
6453
6523
|
--name <name> Ad group name
|
|
6454
6524
|
--objective <type> brand_awareness, engagement, website_visits, video_views, website_conversions, lead_generation
|
|
6455
|
-
--status <s> create: active or draft (defaults to
|
|
6525
|
+
--status <s> create: active or draft (defaults to active). update: active, paused, or archived
|
|
6456
6526
|
--budget-daily <n> Daily budget in account currency
|
|
6457
6527
|
--budget-lifetime <n> Lifetime budget in account currency
|
|
6458
6528
|
--bid-strategy <s> maximum_delivery, manual, target_cost, cost_cap
|
|
@@ -6463,19 +6533,21 @@ ${FLAG.data}
|
|
|
6463
6533
|
|
|
6464
6534
|
Targeting (--data only):
|
|
6465
6535
|
targeting is nested: { geoLocations: { include: [{ type: "country", code }] }, audience: { <facet>: { include?: [ids], exclude?: [ids] } } }.
|
|
6536
|
+
Active (including omitted status) requires at least one geoLocations.include target. Use --data for active creation; named flags without targeting need --status draft.
|
|
6466
6537
|
Values are bare IDs \u2014 use "adkit manage linkedin targeting-search" to find them.
|
|
6467
6538
|
Facets: jobTitles, seniorities, jobFunctions, industries, companySizes, companies, skills, interests, customAudiences, ageRanges, genders.
|
|
6468
6539
|
ageRanges/genders are include-only (LinkedIn rejects them in exclude): ageRanges take tuples like (25,34), genders take FEMALE/MALE.
|
|
6469
6540
|
customAudiences goes inside targeting.audience (never top-level): pass the segment ID/URN. Matched Audiences are created in Campaign Manager, but you list them with "adkit manage linkedin targeting-search --facet customAudiences". Choose a language via platformOverrides.locale.
|
|
6470
6541
|
|
|
6471
6542
|
Notes:
|
|
6543
|
+
Creates are saved as AdKit drafts unless --publish is set. The create status controls the LinkedIn state after publishing.
|
|
6472
6544
|
A live ad group can never go back to draft. targeting on update is a full replace (send the whole targeting object via --data).
|
|
6473
6545
|
Explicit bidding on create requires a compatible --objective. Bidding changes are atomic: send --bid-strategy and --optimization together. manual, target_cost, and cost_cap also require --bid-amount; maximum_delivery rejects it.
|
|
6474
6546
|
LinkedIn further constrains bidding by objective and creative format.
|
|
6475
6547
|
|
|
6476
6548
|
Examples:
|
|
6477
|
-
adkit manage linkedin ad-groups create --campaign 628940516 --name "
|
|
6478
|
-
adkit manage linkedin ad-groups create --
|
|
6549
|
+
adkit manage linkedin ad-groups create --campaign 628940516 --name "Incomplete setup" --budget-daily 50 --objective website_visits --status draft
|
|
6550
|
+
adkit manage linkedin ad-groups create --data '{"adGroups":[{"campaignId":"628940516","name":"US Manual CPC","objective":"website_visits","bidStrategy":"manual","optimization":"clicks","bidAmount":8,"targeting":{"geoLocations":{"include":[{"type":"country","code":"103644278"}]}}}]}'
|
|
6479
6551
|
adkit manage linkedin ad-groups update 361387516 --account 512345678 --status paused
|
|
6480
6552
|
adkit manage linkedin ad-groups create --data '{"adGroups":[{"campaignId":"628940516","name":"US Senior Eng","budget":{"daily":50},"targeting":{"geoLocations":{"include":[{"type":"country","code":"103644278"}]},"audience":{"seniorities":{"include":["6"]},"customAudiences":{"include":["123456"]}}}}]}'`.trim(),
|
|
6481
6553
|
"linkedin ads": `adkit manage linkedin ads \u2014 LinkedIn ads
|
|
@@ -6495,9 +6567,10 @@ ${FLAG.data}
|
|
|
6495
6567
|
--ad-group <id> Parent ad group ID (create only)
|
|
6496
6568
|
--existing-post <urn> Reference an existing share/ugcPost URN (create only)
|
|
6497
6569
|
--name <name> Ad name
|
|
6498
|
-
--status <s> create: active or draft (defaults to
|
|
6570
|
+
--status <s> create: active or draft (defaults to active). update: active, paused, or archived
|
|
6499
6571
|
|
|
6500
6572
|
Create:
|
|
6573
|
+
Creates are saved as AdKit drafts unless --publish is set. The create status controls the LinkedIn state after publishing.
|
|
6501
6574
|
Inline ad: pass --data with a creative \u2014 keys are primaryTexts, headlines, media, url, cta. creative.media needs at least one { role: "image"|"video", id: "urn:li:image:..." } entry.
|
|
6502
6575
|
Reference ad: pass --existing-post <share/ugcPost URN>; omit creative entirely (its text/url/media are ignored).
|
|
6503
6576
|
creative.cta is the button label \u2014 one of: apply, download, view_quote, learn_more, sign_up, subscribe, register, join, attend, request_demo, see_more, buy_now, shop_now. It needs creative.url and cannot be combined with existing-post.
|
package/package.json
CHANGED