@getlatedev/node 0.2.1683 → 0.2.1685
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.d.mts +81 -23
- package/dist/index.d.ts +81 -23
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +5 -3
- package/src/generated/types.gen.ts +82 -24
package/dist/index.d.mts
CHANGED
|
@@ -4662,6 +4662,8 @@ type AdRuleCondition = {
|
|
|
4662
4662
|
*
|
|
4663
4663
|
* For example, `cpc` over `last_complete_hour` `>=` 5 against `last_30d` means the last hour's clicks cost 5 times their 30-day price.
|
|
4664
4664
|
*
|
|
4665
|
+
* `campaign`, on `keyword` and `search_term` rules only, divides by the object's campaign over the same window, from the synced campaign totals. `cpc` `>=` 5 against `campaign` means a click costs 5 times the campaign's average; `spend` `>=` 0.2 means a fifth of the campaign's spend.
|
|
4666
|
+
*
|
|
4665
4667
|
*/
|
|
4666
4668
|
compareTo?: string;
|
|
4667
4669
|
/**
|
|
@@ -4734,6 +4736,9 @@ type AdRuleEvaluation = {
|
|
|
4734
4736
|
};
|
|
4735
4737
|
/**
|
|
4736
4738
|
* Narrows the objects the rule checks. Every filter must hold. A campaign rule reads `name`, `campaign_id`, `goal`, `days_live`, `days_since_change`, `budget_level` and `channel_type`; an ad set rule all but `days_since_change`, plus `campaign_name` and `adset_id`; an ad rule also `adset_name` and `ad_id`.
|
|
4739
|
+
*
|
|
4740
|
+
* A keyword rule reads `name` (the keyword text), `campaign_name`, `adset_name`, `campaign_id`, `adset_id` and `match_type`. A search term rule reads those (`name` is the term) plus `search_term_status` and `blocked_by_negative`.
|
|
4741
|
+
*
|
|
4737
4742
|
*/
|
|
4738
4743
|
type AdRuleFilters = Array<({
|
|
4739
4744
|
/**
|
|
@@ -4763,6 +4768,18 @@ type AdRuleFilters = Array<({
|
|
|
4763
4768
|
change: 'budget' | 'bidding' | 'status' | 'goal';
|
|
4764
4769
|
op: '>=' | '<';
|
|
4765
4770
|
value: number;
|
|
4771
|
+
} | {
|
|
4772
|
+
field: 'match_type';
|
|
4773
|
+
op: 'in' | 'not_in';
|
|
4774
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
4775
|
+
} | {
|
|
4776
|
+
field: 'search_term_status';
|
|
4777
|
+
op: 'in' | 'not_in';
|
|
4778
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
4779
|
+
} | {
|
|
4780
|
+
field: 'blocked_by_negative';
|
|
4781
|
+
op: 'equals';
|
|
4782
|
+
value: boolean;
|
|
4766
4783
|
})>;
|
|
4767
4784
|
/**
|
|
4768
4785
|
* Campaigns judged together, campaign rules only. Each group's numbers and your results are added up across its campaigns, and rates and formulas are computed on the totals: a group's `result:cac_percent` is its total spend over its total revenue.
|
|
@@ -4782,9 +4799,20 @@ type AdRuleGroups = Array<{
|
|
|
4782
4799
|
filters: AdRuleFilters;
|
|
4783
4800
|
}> | null;
|
|
4784
4801
|
/**
|
|
4785
|
-
* Whether the rule checks campaigns, ad sets or
|
|
4802
|
+
* Whether the rule checks campaigns, ad sets, single ads, Google keywords or Google search terms. Each one is evaluated on its own.
|
|
4803
|
+
*
|
|
4804
|
+
* `keyword` and `search_term` read Google Search, on Google Ads accounts only. A keyword's id is `<adGroupId>~<criterionId>`, as `PATCH /v1/ads/keywords/{keywordId}` takes it. A search term is one per ad group, its id `<adGroupId>~<term>`.
|
|
4805
|
+
*
|
|
4806
|
+
* - They read a daily history Zernio fetches from Google. A day keeps its 50,000 rows that spent most.
|
|
4807
|
+
* - Every daily window works, `today` included: today is refreshed at most once an hour.
|
|
4808
|
+
* - A new rule's first runs load its days a few at a time, and fail until all are in.
|
|
4809
|
+
* - Paused keywords are not judged.
|
|
4810
|
+
* - Google lists only what showed at least once, so `impressions` takes `>` or `>=`, never `<` or `<=`.
|
|
4811
|
+
*
|
|
4812
|
+
* They take `spend`, `impressions`, `clicks`, `conversions`, `ctr`, `cpc`, `cpm`, `cpa` and `roas` over whole days, no `usual`, `of`, `top` or `bottom`, and `compareTo` only as `campaign`. A keyword rule can `notify` or `pause`; a search term rule only notifies.
|
|
4813
|
+
*
|
|
4786
4814
|
*/
|
|
4787
|
-
type AdRuleLevel = 'campaign' | 'adset' | 'ad';
|
|
4815
|
+
type AdRuleLevel = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4788
4816
|
/**
|
|
4789
4817
|
* Turns matches into alerts. An object acts and notifies only after `confirmChecks` matching runs in a row; its alert stays open while it matches or `hold` holds, and resolves on its own (a day after the object stops delivering). Cooldown and caps still decide repeat actions.
|
|
4790
4818
|
*
|
|
@@ -4806,11 +4834,18 @@ type AdRuleLifecycle = {
|
|
|
4806
4834
|
};
|
|
4807
4835
|
type AdRuleObjectEvaluation = {
|
|
4808
4836
|
/**
|
|
4809
|
-
* Platform ID of the campaign or ad
|
|
4837
|
+
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{adGroupId}~{term}`.
|
|
4810
4838
|
*/
|
|
4811
4839
|
id: string;
|
|
4840
|
+
/**
|
|
4841
|
+
* The object's name: the keyword text or the search term.
|
|
4842
|
+
*/
|
|
4812
4843
|
name: string;
|
|
4813
4844
|
campaignId: (string) | null;
|
|
4845
|
+
/**
|
|
4846
|
+
* Absent on runs recorded before November 2026.
|
|
4847
|
+
*/
|
|
4848
|
+
campaignName?: (string) | null;
|
|
4814
4849
|
/**
|
|
4815
4850
|
* True when every condition holds.
|
|
4816
4851
|
*/
|
|
@@ -4850,12 +4885,19 @@ type AdRuleRun = {
|
|
|
4850
4885
|
*
|
|
4851
4886
|
*/
|
|
4852
4887
|
outcome: 'triggered' | 'cooldown' | 'daily_limit' | 'no_match' | 'failed' | 'paused';
|
|
4888
|
+
/**
|
|
4889
|
+
* Objects the rule judged. 0 means its campaigns and filters matched nothing that is running.
|
|
4890
|
+
*/
|
|
4853
4891
|
objectsEvaluated: number;
|
|
4854
4892
|
actedObjectIds: Array<(string)>;
|
|
4855
4893
|
/**
|
|
4856
|
-
* The matched objects with their condition values, and what each action did.
|
|
4894
|
+
* The matched objects with their condition values, and what each action did. Null on a run that matched nothing, unless some objects could not be read.
|
|
4857
4895
|
*/
|
|
4858
4896
|
evaluation: {
|
|
4897
|
+
/**
|
|
4898
|
+
* On a run that matched nothing: how many objects had a condition whose value could not be read, so they could not match. A campaign with under 3 of the 4 previous weeks of data has no `usual` yet.
|
|
4899
|
+
*/
|
|
4900
|
+
unreadObjects?: number;
|
|
4859
4901
|
/**
|
|
4860
4902
|
* The rule as it was when this run happened, so its actions stay readable after the rule is renamed or deleted. Absent on runs recorded before October 2026.
|
|
4861
4903
|
*/
|
|
@@ -4865,7 +4907,7 @@ type AdRuleRun = {
|
|
|
4865
4907
|
accountId?: string;
|
|
4866
4908
|
platform?: string;
|
|
4867
4909
|
platformAdAccountId?: string;
|
|
4868
|
-
level?: 'campaign' | 'adset';
|
|
4910
|
+
level?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4869
4911
|
};
|
|
4870
4912
|
today?: string;
|
|
4871
4913
|
timezone?: string;
|
|
@@ -4875,7 +4917,14 @@ type AdRuleRun = {
|
|
|
4875
4917
|
* Where the run's hourly windows ended. Absent on runs recorded before November 2026.
|
|
4876
4918
|
*/
|
|
4877
4919
|
hourlyThrough?: (string) | null;
|
|
4920
|
+
/**
|
|
4921
|
+
* The matched objects, at most 200. `matchedTotal` has the full count.
|
|
4922
|
+
*/
|
|
4878
4923
|
matched?: Array<AdRuleObjectEvaluation>;
|
|
4924
|
+
/**
|
|
4925
|
+
* How many objects matched, including those past the 200 recorded. Absent on runs recorded before November 2026.
|
|
4926
|
+
*/
|
|
4927
|
+
matchedTotal?: number;
|
|
4879
4928
|
actions?: Array<{
|
|
4880
4929
|
objectId: string;
|
|
4881
4930
|
type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
|
|
@@ -4911,6 +4960,7 @@ type AdRuleRun = {
|
|
|
4911
4960
|
} | null;
|
|
4912
4961
|
error: (string) | null;
|
|
4913
4962
|
};
|
|
4963
|
+
type level2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4914
4964
|
/**
|
|
4915
4965
|
* Either `everyMinutes` or `times`. Sending a schedule replaces the rule's whole timing. Without one, a new rule runs every 60 minutes.
|
|
4916
4966
|
*/
|
|
@@ -4992,7 +5042,7 @@ type AdsAlert = {
|
|
|
4992
5042
|
};
|
|
4993
5043
|
type kind = 'ad_rejected' | 'delivery_issue' | 'payment' | 'budget_limited' | 'spend_no_results' | 'connection_lost' | 'sync_failing';
|
|
4994
5044
|
type severity = 'error' | 'warning' | 'info';
|
|
4995
|
-
type
|
|
5045
|
+
type level3 = 'ad_account' | 'campaign' | 'ad_set' | 'ad';
|
|
4996
5046
|
/**
|
|
4997
5047
|
* One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.
|
|
4998
5048
|
*/
|
|
@@ -6106,7 +6156,7 @@ type AutomationAction = AutomationActionResult & {
|
|
|
6106
6156
|
automationName: string;
|
|
6107
6157
|
checkId: string;
|
|
6108
6158
|
subject: {
|
|
6109
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
6159
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6110
6160
|
id?: string;
|
|
6111
6161
|
name?: (string) | null;
|
|
6112
6162
|
};
|
|
@@ -6118,7 +6168,7 @@ type AutomationAction = AutomationActionResult & {
|
|
|
6118
6168
|
currency: (string) | null;
|
|
6119
6169
|
createdAt: string;
|
|
6120
6170
|
};
|
|
6121
|
-
type kind2 = 'campaign' | 'adset' | 'ad';
|
|
6171
|
+
type kind2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6122
6172
|
/**
|
|
6123
6173
|
* What an ad rule did to one object, as an absolute change: a budget change reads as the budget it set.
|
|
6124
6174
|
*/
|
|
@@ -6190,6 +6240,18 @@ type AutomationAdFilter = {
|
|
|
6190
6240
|
field: "channel_type";
|
|
6191
6241
|
op: 'in' | 'not_in';
|
|
6192
6242
|
values: Array<('SEARCH' | 'DISPLAY' | 'SHOPPING' | 'HOTEL' | 'VIDEO' | 'MULTI_CHANNEL' | 'LOCAL' | 'SMART' | 'PERFORMANCE_MAX' | 'LOCAL_SERVICES' | 'TRAVEL' | 'DEMAND_GEN')>;
|
|
6243
|
+
} | {
|
|
6244
|
+
field: "match_type";
|
|
6245
|
+
op: 'in' | 'not_in';
|
|
6246
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
6247
|
+
} | {
|
|
6248
|
+
field: "search_term_status";
|
|
6249
|
+
op: 'in' | 'not_in';
|
|
6250
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
6251
|
+
} | {
|
|
6252
|
+
field: "blocked_by_negative";
|
|
6253
|
+
op: "equals";
|
|
6254
|
+
value: boolean;
|
|
6193
6255
|
};
|
|
6194
6256
|
type field = 'name' | 'campaign_name' | 'adset_name' | 'goal';
|
|
6195
6257
|
type op2 = 'contains' | 'not_contains' | 'equals' | 'not_equals' | 'starts_with';
|
|
@@ -6249,7 +6311,7 @@ type status7 = 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
|
6249
6311
|
type AutomationApprovalChange = {
|
|
6250
6312
|
actionId: string;
|
|
6251
6313
|
subject: {
|
|
6252
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
6314
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6253
6315
|
id: string;
|
|
6254
6316
|
name: (string) | null;
|
|
6255
6317
|
};
|
|
@@ -6396,7 +6458,7 @@ type AutomationBacktestDay = {
|
|
|
6396
6458
|
heldBack: number;
|
|
6397
6459
|
actions: Array<{
|
|
6398
6460
|
subject: {
|
|
6399
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
6461
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6400
6462
|
id: string;
|
|
6401
6463
|
name: string;
|
|
6402
6464
|
campaignId: (string) | null;
|
|
@@ -6674,7 +6736,7 @@ type AutomationPreview = {
|
|
|
6674
6736
|
*/
|
|
6675
6737
|
subjects: Array<{
|
|
6676
6738
|
subject: {
|
|
6677
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
6739
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6678
6740
|
/**
|
|
6679
6741
|
* Platform ID.
|
|
6680
6742
|
*/
|
|
@@ -6908,7 +6970,7 @@ type AutomationSubjects = {
|
|
|
6908
6970
|
/**
|
|
6909
6971
|
* The objects judged one by one.
|
|
6910
6972
|
*/
|
|
6911
|
-
each: 'campaign' | 'adset' | 'ad';
|
|
6973
|
+
each: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6912
6974
|
/**
|
|
6913
6975
|
* The ad account to check. One per ad rule, and an edit cannot move it to another.
|
|
6914
6976
|
*/
|
|
@@ -6949,7 +7011,7 @@ type AutomationSubjects = {
|
|
|
6949
7011
|
/**
|
|
6950
7012
|
* The objects judged one by one.
|
|
6951
7013
|
*/
|
|
6952
|
-
type each = 'campaign' | 'adset' | 'ad';
|
|
7014
|
+
type each = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6953
7015
|
type AutomationTemplate = {
|
|
6954
7016
|
/**
|
|
6955
7017
|
* A team template's id (24 hex characters), or the id of one of Zernio's templates such as `stop_losers`.
|
|
@@ -15023,7 +15085,7 @@ type GoogleListingGroupDimension = {
|
|
|
15023
15085
|
index: 'INDEX0' | 'INDEX1' | 'INDEX2' | 'INDEX3' | 'INDEX4';
|
|
15024
15086
|
};
|
|
15025
15087
|
};
|
|
15026
|
-
type
|
|
15088
|
+
type level4 = 'LEVEL1' | 'LEVEL2' | 'LEVEL3' | 'LEVEL4' | 'LEVEL5';
|
|
15027
15089
|
type condition = 'NEW' | 'REFURBISHED' | 'USED';
|
|
15028
15090
|
type channel4 = 'ONLINE' | 'LOCAL';
|
|
15029
15091
|
type index = 'INDEX0' | 'INDEX1' | 'INDEX2' | 'INDEX3' | 'INDEX4';
|
|
@@ -23173,7 +23235,7 @@ type event10 = 'ad.created';
|
|
|
23173
23235
|
/**
|
|
23174
23236
|
* Always `AD`.
|
|
23175
23237
|
*/
|
|
23176
|
-
type
|
|
23238
|
+
type level5 = 'AD';
|
|
23177
23239
|
/**
|
|
23178
23240
|
* Where the ad was created. `zernio` for ads created through Zernio, `platform` for ads the sync detected.
|
|
23179
23241
|
*/
|
|
@@ -23336,9 +23398,9 @@ type WebhookPayloadAdRuleTriggered = {
|
|
|
23336
23398
|
id: string;
|
|
23337
23399
|
name: string;
|
|
23338
23400
|
/**
|
|
23339
|
-
* Whether the rule evaluates campaigns, ad sets or
|
|
23401
|
+
* Whether the rule evaluates campaigns, ad sets, ads, Google keywords or Google search terms.
|
|
23340
23402
|
*/
|
|
23341
|
-
level: 'campaign' | 'adset' | 'ad';
|
|
23403
|
+
level: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
23342
23404
|
/**
|
|
23343
23405
|
* Platform-native ad account ID the rule watches.
|
|
23344
23406
|
*/
|
|
@@ -23477,10 +23539,6 @@ type WebhookPayloadAdRuleTriggered = {
|
|
|
23477
23539
|
timestamp: string;
|
|
23478
23540
|
};
|
|
23479
23541
|
type event13 = 'ad_rule.triggered';
|
|
23480
|
-
/**
|
|
23481
|
-
* Whether the rule evaluates campaigns, ad sets or ads.
|
|
23482
|
-
*/
|
|
23483
|
-
type level5 = 'campaign' | 'adset' | 'ad';
|
|
23484
23542
|
/**
|
|
23485
23543
|
* Webhook payload for the `ad_set.created` event. Fires when an ad set is created through Zernio (API, MCP or dashboard) or detected by the sync, once per ad set, after its row is recorded so `GET /v1/ads/ad-sets/{adSetId}` finds it.
|
|
23486
23544
|
*
|
|
@@ -58961,7 +59019,7 @@ type GetAutomationCatalogResponse = ({
|
|
|
58961
59019
|
* Ad rule subjects.
|
|
58962
59020
|
*/
|
|
58963
59021
|
subjects: Array<{
|
|
58964
|
-
each?: 'campaign' | 'adset' | 'ad';
|
|
59022
|
+
each?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
58965
59023
|
platforms?: Array<(string)>;
|
|
58966
59024
|
metrics?: Array<{
|
|
58967
59025
|
metric?: string;
|
|
@@ -59523,7 +59581,7 @@ type CreateAdRuleData = {
|
|
|
59523
59581
|
adAccountId: string;
|
|
59524
59582
|
level: AdRuleLevel;
|
|
59525
59583
|
/**
|
|
59526
|
-
* Only check these platform campaign IDs (or
|
|
59584
|
+
* Only check these platform campaign IDs (or what sits in them). Leave out to check the whole ad account.
|
|
59527
59585
|
*/
|
|
59528
59586
|
campaignIds?: Array<(string)>;
|
|
59529
59587
|
filters?: AdRuleFilters;
|
package/dist/index.d.ts
CHANGED
|
@@ -4662,6 +4662,8 @@ type AdRuleCondition = {
|
|
|
4662
4662
|
*
|
|
4663
4663
|
* For example, `cpc` over `last_complete_hour` `>=` 5 against `last_30d` means the last hour's clicks cost 5 times their 30-day price.
|
|
4664
4664
|
*
|
|
4665
|
+
* `campaign`, on `keyword` and `search_term` rules only, divides by the object's campaign over the same window, from the synced campaign totals. `cpc` `>=` 5 against `campaign` means a click costs 5 times the campaign's average; `spend` `>=` 0.2 means a fifth of the campaign's spend.
|
|
4666
|
+
*
|
|
4665
4667
|
*/
|
|
4666
4668
|
compareTo?: string;
|
|
4667
4669
|
/**
|
|
@@ -4734,6 +4736,9 @@ type AdRuleEvaluation = {
|
|
|
4734
4736
|
};
|
|
4735
4737
|
/**
|
|
4736
4738
|
* Narrows the objects the rule checks. Every filter must hold. A campaign rule reads `name`, `campaign_id`, `goal`, `days_live`, `days_since_change`, `budget_level` and `channel_type`; an ad set rule all but `days_since_change`, plus `campaign_name` and `adset_id`; an ad rule also `adset_name` and `ad_id`.
|
|
4739
|
+
*
|
|
4740
|
+
* A keyword rule reads `name` (the keyword text), `campaign_name`, `adset_name`, `campaign_id`, `adset_id` and `match_type`. A search term rule reads those (`name` is the term) plus `search_term_status` and `blocked_by_negative`.
|
|
4741
|
+
*
|
|
4737
4742
|
*/
|
|
4738
4743
|
type AdRuleFilters = Array<({
|
|
4739
4744
|
/**
|
|
@@ -4763,6 +4768,18 @@ type AdRuleFilters = Array<({
|
|
|
4763
4768
|
change: 'budget' | 'bidding' | 'status' | 'goal';
|
|
4764
4769
|
op: '>=' | '<';
|
|
4765
4770
|
value: number;
|
|
4771
|
+
} | {
|
|
4772
|
+
field: 'match_type';
|
|
4773
|
+
op: 'in' | 'not_in';
|
|
4774
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
4775
|
+
} | {
|
|
4776
|
+
field: 'search_term_status';
|
|
4777
|
+
op: 'in' | 'not_in';
|
|
4778
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
4779
|
+
} | {
|
|
4780
|
+
field: 'blocked_by_negative';
|
|
4781
|
+
op: 'equals';
|
|
4782
|
+
value: boolean;
|
|
4766
4783
|
})>;
|
|
4767
4784
|
/**
|
|
4768
4785
|
* Campaigns judged together, campaign rules only. Each group's numbers and your results are added up across its campaigns, and rates and formulas are computed on the totals: a group's `result:cac_percent` is its total spend over its total revenue.
|
|
@@ -4782,9 +4799,20 @@ type AdRuleGroups = Array<{
|
|
|
4782
4799
|
filters: AdRuleFilters;
|
|
4783
4800
|
}> | null;
|
|
4784
4801
|
/**
|
|
4785
|
-
* Whether the rule checks campaigns, ad sets or
|
|
4802
|
+
* Whether the rule checks campaigns, ad sets, single ads, Google keywords or Google search terms. Each one is evaluated on its own.
|
|
4803
|
+
*
|
|
4804
|
+
* `keyword` and `search_term` read Google Search, on Google Ads accounts only. A keyword's id is `<adGroupId>~<criterionId>`, as `PATCH /v1/ads/keywords/{keywordId}` takes it. A search term is one per ad group, its id `<adGroupId>~<term>`.
|
|
4805
|
+
*
|
|
4806
|
+
* - They read a daily history Zernio fetches from Google. A day keeps its 50,000 rows that spent most.
|
|
4807
|
+
* - Every daily window works, `today` included: today is refreshed at most once an hour.
|
|
4808
|
+
* - A new rule's first runs load its days a few at a time, and fail until all are in.
|
|
4809
|
+
* - Paused keywords are not judged.
|
|
4810
|
+
* - Google lists only what showed at least once, so `impressions` takes `>` or `>=`, never `<` or `<=`.
|
|
4811
|
+
*
|
|
4812
|
+
* They take `spend`, `impressions`, `clicks`, `conversions`, `ctr`, `cpc`, `cpm`, `cpa` and `roas` over whole days, no `usual`, `of`, `top` or `bottom`, and `compareTo` only as `campaign`. A keyword rule can `notify` or `pause`; a search term rule only notifies.
|
|
4813
|
+
*
|
|
4786
4814
|
*/
|
|
4787
|
-
type AdRuleLevel = 'campaign' | 'adset' | 'ad';
|
|
4815
|
+
type AdRuleLevel = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4788
4816
|
/**
|
|
4789
4817
|
* Turns matches into alerts. An object acts and notifies only after `confirmChecks` matching runs in a row; its alert stays open while it matches or `hold` holds, and resolves on its own (a day after the object stops delivering). Cooldown and caps still decide repeat actions.
|
|
4790
4818
|
*
|
|
@@ -4806,11 +4834,18 @@ type AdRuleLifecycle = {
|
|
|
4806
4834
|
};
|
|
4807
4835
|
type AdRuleObjectEvaluation = {
|
|
4808
4836
|
/**
|
|
4809
|
-
* Platform ID of the campaign or ad
|
|
4837
|
+
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{adGroupId}~{term}`.
|
|
4810
4838
|
*/
|
|
4811
4839
|
id: string;
|
|
4840
|
+
/**
|
|
4841
|
+
* The object's name: the keyword text or the search term.
|
|
4842
|
+
*/
|
|
4812
4843
|
name: string;
|
|
4813
4844
|
campaignId: (string) | null;
|
|
4845
|
+
/**
|
|
4846
|
+
* Absent on runs recorded before November 2026.
|
|
4847
|
+
*/
|
|
4848
|
+
campaignName?: (string) | null;
|
|
4814
4849
|
/**
|
|
4815
4850
|
* True when every condition holds.
|
|
4816
4851
|
*/
|
|
@@ -4850,12 +4885,19 @@ type AdRuleRun = {
|
|
|
4850
4885
|
*
|
|
4851
4886
|
*/
|
|
4852
4887
|
outcome: 'triggered' | 'cooldown' | 'daily_limit' | 'no_match' | 'failed' | 'paused';
|
|
4888
|
+
/**
|
|
4889
|
+
* Objects the rule judged. 0 means its campaigns and filters matched nothing that is running.
|
|
4890
|
+
*/
|
|
4853
4891
|
objectsEvaluated: number;
|
|
4854
4892
|
actedObjectIds: Array<(string)>;
|
|
4855
4893
|
/**
|
|
4856
|
-
* The matched objects with their condition values, and what each action did.
|
|
4894
|
+
* The matched objects with their condition values, and what each action did. Null on a run that matched nothing, unless some objects could not be read.
|
|
4857
4895
|
*/
|
|
4858
4896
|
evaluation: {
|
|
4897
|
+
/**
|
|
4898
|
+
* On a run that matched nothing: how many objects had a condition whose value could not be read, so they could not match. A campaign with under 3 of the 4 previous weeks of data has no `usual` yet.
|
|
4899
|
+
*/
|
|
4900
|
+
unreadObjects?: number;
|
|
4859
4901
|
/**
|
|
4860
4902
|
* The rule as it was when this run happened, so its actions stay readable after the rule is renamed or deleted. Absent on runs recorded before October 2026.
|
|
4861
4903
|
*/
|
|
@@ -4865,7 +4907,7 @@ type AdRuleRun = {
|
|
|
4865
4907
|
accountId?: string;
|
|
4866
4908
|
platform?: string;
|
|
4867
4909
|
platformAdAccountId?: string;
|
|
4868
|
-
level?: 'campaign' | 'adset';
|
|
4910
|
+
level?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4869
4911
|
};
|
|
4870
4912
|
today?: string;
|
|
4871
4913
|
timezone?: string;
|
|
@@ -4875,7 +4917,14 @@ type AdRuleRun = {
|
|
|
4875
4917
|
* Where the run's hourly windows ended. Absent on runs recorded before November 2026.
|
|
4876
4918
|
*/
|
|
4877
4919
|
hourlyThrough?: (string) | null;
|
|
4920
|
+
/**
|
|
4921
|
+
* The matched objects, at most 200. `matchedTotal` has the full count.
|
|
4922
|
+
*/
|
|
4878
4923
|
matched?: Array<AdRuleObjectEvaluation>;
|
|
4924
|
+
/**
|
|
4925
|
+
* How many objects matched, including those past the 200 recorded. Absent on runs recorded before November 2026.
|
|
4926
|
+
*/
|
|
4927
|
+
matchedTotal?: number;
|
|
4879
4928
|
actions?: Array<{
|
|
4880
4929
|
objectId: string;
|
|
4881
4930
|
type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
|
|
@@ -4911,6 +4960,7 @@ type AdRuleRun = {
|
|
|
4911
4960
|
} | null;
|
|
4912
4961
|
error: (string) | null;
|
|
4913
4962
|
};
|
|
4963
|
+
type level2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4914
4964
|
/**
|
|
4915
4965
|
* Either `everyMinutes` or `times`. Sending a schedule replaces the rule's whole timing. Without one, a new rule runs every 60 minutes.
|
|
4916
4966
|
*/
|
|
@@ -4992,7 +5042,7 @@ type AdsAlert = {
|
|
|
4992
5042
|
};
|
|
4993
5043
|
type kind = 'ad_rejected' | 'delivery_issue' | 'payment' | 'budget_limited' | 'spend_no_results' | 'connection_lost' | 'sync_failing';
|
|
4994
5044
|
type severity = 'error' | 'warning' | 'info';
|
|
4995
|
-
type
|
|
5045
|
+
type level3 = 'ad_account' | 'campaign' | 'ad_set' | 'ad';
|
|
4996
5046
|
/**
|
|
4997
5047
|
* One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.
|
|
4998
5048
|
*/
|
|
@@ -6106,7 +6156,7 @@ type AutomationAction = AutomationActionResult & {
|
|
|
6106
6156
|
automationName: string;
|
|
6107
6157
|
checkId: string;
|
|
6108
6158
|
subject: {
|
|
6109
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
6159
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6110
6160
|
id?: string;
|
|
6111
6161
|
name?: (string) | null;
|
|
6112
6162
|
};
|
|
@@ -6118,7 +6168,7 @@ type AutomationAction = AutomationActionResult & {
|
|
|
6118
6168
|
currency: (string) | null;
|
|
6119
6169
|
createdAt: string;
|
|
6120
6170
|
};
|
|
6121
|
-
type kind2 = 'campaign' | 'adset' | 'ad';
|
|
6171
|
+
type kind2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6122
6172
|
/**
|
|
6123
6173
|
* What an ad rule did to one object, as an absolute change: a budget change reads as the budget it set.
|
|
6124
6174
|
*/
|
|
@@ -6190,6 +6240,18 @@ type AutomationAdFilter = {
|
|
|
6190
6240
|
field: "channel_type";
|
|
6191
6241
|
op: 'in' | 'not_in';
|
|
6192
6242
|
values: Array<('SEARCH' | 'DISPLAY' | 'SHOPPING' | 'HOTEL' | 'VIDEO' | 'MULTI_CHANNEL' | 'LOCAL' | 'SMART' | 'PERFORMANCE_MAX' | 'LOCAL_SERVICES' | 'TRAVEL' | 'DEMAND_GEN')>;
|
|
6243
|
+
} | {
|
|
6244
|
+
field: "match_type";
|
|
6245
|
+
op: 'in' | 'not_in';
|
|
6246
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
6247
|
+
} | {
|
|
6248
|
+
field: "search_term_status";
|
|
6249
|
+
op: 'in' | 'not_in';
|
|
6250
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
6251
|
+
} | {
|
|
6252
|
+
field: "blocked_by_negative";
|
|
6253
|
+
op: "equals";
|
|
6254
|
+
value: boolean;
|
|
6193
6255
|
};
|
|
6194
6256
|
type field = 'name' | 'campaign_name' | 'adset_name' | 'goal';
|
|
6195
6257
|
type op2 = 'contains' | 'not_contains' | 'equals' | 'not_equals' | 'starts_with';
|
|
@@ -6249,7 +6311,7 @@ type status7 = 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
|
6249
6311
|
type AutomationApprovalChange = {
|
|
6250
6312
|
actionId: string;
|
|
6251
6313
|
subject: {
|
|
6252
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
6314
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6253
6315
|
id: string;
|
|
6254
6316
|
name: (string) | null;
|
|
6255
6317
|
};
|
|
@@ -6396,7 +6458,7 @@ type AutomationBacktestDay = {
|
|
|
6396
6458
|
heldBack: number;
|
|
6397
6459
|
actions: Array<{
|
|
6398
6460
|
subject: {
|
|
6399
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
6461
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6400
6462
|
id: string;
|
|
6401
6463
|
name: string;
|
|
6402
6464
|
campaignId: (string) | null;
|
|
@@ -6674,7 +6736,7 @@ type AutomationPreview = {
|
|
|
6674
6736
|
*/
|
|
6675
6737
|
subjects: Array<{
|
|
6676
6738
|
subject: {
|
|
6677
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
6739
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6678
6740
|
/**
|
|
6679
6741
|
* Platform ID.
|
|
6680
6742
|
*/
|
|
@@ -6908,7 +6970,7 @@ type AutomationSubjects = {
|
|
|
6908
6970
|
/**
|
|
6909
6971
|
* The objects judged one by one.
|
|
6910
6972
|
*/
|
|
6911
|
-
each: 'campaign' | 'adset' | 'ad';
|
|
6973
|
+
each: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6912
6974
|
/**
|
|
6913
6975
|
* The ad account to check. One per ad rule, and an edit cannot move it to another.
|
|
6914
6976
|
*/
|
|
@@ -6949,7 +7011,7 @@ type AutomationSubjects = {
|
|
|
6949
7011
|
/**
|
|
6950
7012
|
* The objects judged one by one.
|
|
6951
7013
|
*/
|
|
6952
|
-
type each = 'campaign' | 'adset' | 'ad';
|
|
7014
|
+
type each = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
6953
7015
|
type AutomationTemplate = {
|
|
6954
7016
|
/**
|
|
6955
7017
|
* A team template's id (24 hex characters), or the id of one of Zernio's templates such as `stop_losers`.
|
|
@@ -15023,7 +15085,7 @@ type GoogleListingGroupDimension = {
|
|
|
15023
15085
|
index: 'INDEX0' | 'INDEX1' | 'INDEX2' | 'INDEX3' | 'INDEX4';
|
|
15024
15086
|
};
|
|
15025
15087
|
};
|
|
15026
|
-
type
|
|
15088
|
+
type level4 = 'LEVEL1' | 'LEVEL2' | 'LEVEL3' | 'LEVEL4' | 'LEVEL5';
|
|
15027
15089
|
type condition = 'NEW' | 'REFURBISHED' | 'USED';
|
|
15028
15090
|
type channel4 = 'ONLINE' | 'LOCAL';
|
|
15029
15091
|
type index = 'INDEX0' | 'INDEX1' | 'INDEX2' | 'INDEX3' | 'INDEX4';
|
|
@@ -23173,7 +23235,7 @@ type event10 = 'ad.created';
|
|
|
23173
23235
|
/**
|
|
23174
23236
|
* Always `AD`.
|
|
23175
23237
|
*/
|
|
23176
|
-
type
|
|
23238
|
+
type level5 = 'AD';
|
|
23177
23239
|
/**
|
|
23178
23240
|
* Where the ad was created. `zernio` for ads created through Zernio, `platform` for ads the sync detected.
|
|
23179
23241
|
*/
|
|
@@ -23336,9 +23398,9 @@ type WebhookPayloadAdRuleTriggered = {
|
|
|
23336
23398
|
id: string;
|
|
23337
23399
|
name: string;
|
|
23338
23400
|
/**
|
|
23339
|
-
* Whether the rule evaluates campaigns, ad sets or
|
|
23401
|
+
* Whether the rule evaluates campaigns, ad sets, ads, Google keywords or Google search terms.
|
|
23340
23402
|
*/
|
|
23341
|
-
level: 'campaign' | 'adset' | 'ad';
|
|
23403
|
+
level: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
23342
23404
|
/**
|
|
23343
23405
|
* Platform-native ad account ID the rule watches.
|
|
23344
23406
|
*/
|
|
@@ -23477,10 +23539,6 @@ type WebhookPayloadAdRuleTriggered = {
|
|
|
23477
23539
|
timestamp: string;
|
|
23478
23540
|
};
|
|
23479
23541
|
type event13 = 'ad_rule.triggered';
|
|
23480
|
-
/**
|
|
23481
|
-
* Whether the rule evaluates campaigns, ad sets or ads.
|
|
23482
|
-
*/
|
|
23483
|
-
type level5 = 'campaign' | 'adset' | 'ad';
|
|
23484
23542
|
/**
|
|
23485
23543
|
* Webhook payload for the `ad_set.created` event. Fires when an ad set is created through Zernio (API, MCP or dashboard) or detected by the sync, once per ad set, after its row is recorded so `GET /v1/ads/ad-sets/{adSetId}` finds it.
|
|
23486
23544
|
*
|
|
@@ -58961,7 +59019,7 @@ type GetAutomationCatalogResponse = ({
|
|
|
58961
59019
|
* Ad rule subjects.
|
|
58962
59020
|
*/
|
|
58963
59021
|
subjects: Array<{
|
|
58964
|
-
each?: 'campaign' | 'adset' | 'ad';
|
|
59022
|
+
each?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
58965
59023
|
platforms?: Array<(string)>;
|
|
58966
59024
|
metrics?: Array<{
|
|
58967
59025
|
metric?: string;
|
|
@@ -59523,7 +59581,7 @@ type CreateAdRuleData = {
|
|
|
59523
59581
|
adAccountId: string;
|
|
59524
59582
|
level: AdRuleLevel;
|
|
59525
59583
|
/**
|
|
59526
|
-
* Only check these platform campaign IDs (or
|
|
59584
|
+
* Only check these platform campaign IDs (or what sits in them). Leave out to check the whole ad account.
|
|
59527
59585
|
*/
|
|
59528
59586
|
campaignIds?: Array<(string)>;
|
|
59529
59587
|
filters?: AdRuleFilters;
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
36
36
|
// package.json
|
|
37
37
|
var package_default = {
|
|
38
38
|
name: "@getlatedev/node",
|
|
39
|
-
version: "0.2.
|
|
39
|
+
version: "0.2.1685",
|
|
40
40
|
description: "The official Node.js library for the Zernio API",
|
|
41
41
|
main: "dist/index.js",
|
|
42
42
|
module: "dist/index.mjs",
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@getlatedev/node",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.1685",
|
|
9
9
|
description: "The official Node.js library for the Zernio API",
|
|
10
10
|
main: "dist/index.js",
|
|
11
11
|
module: "dist/index.mjs",
|
package/package.json
CHANGED
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -13954,13 +13954,13 @@ export const listAdRules = <ThrowOnError extends boolean = false>(options?: Opti
|
|
|
13954
13954
|
|
|
13955
13955
|
/**
|
|
13956
13956
|
* Create an ad rule
|
|
13957
|
-
* Creates a rule that checks the campaigns
|
|
13957
|
+
* Creates a rule that checks the campaigns, ad sets, ads, keywords or search terms of one ad account on a schedule and acts on each one that meets every condition.
|
|
13958
13958
|
*
|
|
13959
|
-
* Rules support Meta, Google, TikTok, LinkedIn, Pinterest, X and Reddit ads connections. Use `POST /v1/ads/rules/{ruleId}/preview` to see what a rule would match before enabling it.
|
|
13959
|
+
* Rules support Meta, Google, TikTok, LinkedIn, Pinterest, X and Reddit ads connections. Keyword and search term rules are Google only. Use `POST /v1/ads/rules/{ruleId}/preview` to see what a rule would match before enabling it.
|
|
13960
13960
|
*
|
|
13961
13961
|
* ### Evaluation
|
|
13962
13962
|
*
|
|
13963
|
-
* Each
|
|
13963
|
+
* Each object is evaluated on its own, over the ad account's calendar days. Campaigns, ad sets and ads read the metrics Zernio syncs; keywords and search terms are summed from the daily history Zernio keeps of them.
|
|
13964
13964
|
*
|
|
13965
13965
|
* ### Actions
|
|
13966
13966
|
*
|
|
@@ -13970,6 +13970,8 @@ export const listAdRules = <ThrowOnError extends boolean = false>(options?: Opti
|
|
|
13970
13970
|
* - `activate`
|
|
13971
13971
|
* - `adjust_budget`
|
|
13972
13972
|
*
|
|
13973
|
+
* A keyword rule can notify and pause; a search term rule only notifies.
|
|
13974
|
+
*
|
|
13973
13975
|
* ### Cooldown
|
|
13974
13976
|
*
|
|
13975
13977
|
* After acting on an object, the rule leaves that object alone for `cooldownMinutes`. A rule that pauses, activates or adjusts budgets needs a cooldown at least as long as its schedule.
|
|
@@ -2234,6 +2234,8 @@ export type AdRuleCondition = {
|
|
|
2234
2234
|
*
|
|
2235
2235
|
* For example, `cpc` over `last_complete_hour` `>=` 5 against `last_30d` means the last hour's clicks cost 5 times their 30-day price.
|
|
2236
2236
|
*
|
|
2237
|
+
* `campaign`, on `keyword` and `search_term` rules only, divides by the object's campaign over the same window, from the synced campaign totals. `cpc` `>=` 5 against `campaign` means a click costs 5 times the campaign's average; `spend` `>=` 0.2 means a fifth of the campaign's spend.
|
|
2238
|
+
*
|
|
2237
2239
|
*/
|
|
2238
2240
|
compareTo?: string;
|
|
2239
2241
|
/**
|
|
@@ -2312,6 +2314,9 @@ export type AdRuleEvaluation = {
|
|
|
2312
2314
|
|
|
2313
2315
|
/**
|
|
2314
2316
|
* Narrows the objects the rule checks. Every filter must hold. A campaign rule reads `name`, `campaign_id`, `goal`, `days_live`, `days_since_change`, `budget_level` and `channel_type`; an ad set rule all but `days_since_change`, plus `campaign_name` and `adset_id`; an ad rule also `adset_name` and `ad_id`.
|
|
2317
|
+
*
|
|
2318
|
+
* A keyword rule reads `name` (the keyword text), `campaign_name`, `adset_name`, `campaign_id`, `adset_id` and `match_type`. A search term rule reads those (`name` is the term) plus `search_term_status` and `blocked_by_negative`.
|
|
2319
|
+
*
|
|
2315
2320
|
*/
|
|
2316
2321
|
export type AdRuleFilters = Array<({
|
|
2317
2322
|
/**
|
|
@@ -2341,6 +2346,18 @@ export type AdRuleFilters = Array<({
|
|
|
2341
2346
|
change: 'budget' | 'bidding' | 'status' | 'goal';
|
|
2342
2347
|
op: '>=' | '<';
|
|
2343
2348
|
value: number;
|
|
2349
|
+
} | {
|
|
2350
|
+
field: 'match_type';
|
|
2351
|
+
op: 'in' | 'not_in';
|
|
2352
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
2353
|
+
} | {
|
|
2354
|
+
field: 'search_term_status';
|
|
2355
|
+
op: 'in' | 'not_in';
|
|
2356
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
2357
|
+
} | {
|
|
2358
|
+
field: 'blocked_by_negative';
|
|
2359
|
+
op: 'equals';
|
|
2360
|
+
value: boolean;
|
|
2344
2361
|
})>;
|
|
2345
2362
|
|
|
2346
2363
|
/**
|
|
@@ -2362,9 +2379,20 @@ export type AdRuleGroups = Array<{
|
|
|
2362
2379
|
}> | null;
|
|
2363
2380
|
|
|
2364
2381
|
/**
|
|
2365
|
-
* Whether the rule checks campaigns, ad sets or
|
|
2382
|
+
* Whether the rule checks campaigns, ad sets, single ads, Google keywords or Google search terms. Each one is evaluated on its own.
|
|
2383
|
+
*
|
|
2384
|
+
* `keyword` and `search_term` read Google Search, on Google Ads accounts only. A keyword's id is `<adGroupId>~<criterionId>`, as `PATCH /v1/ads/keywords/{keywordId}` takes it. A search term is one per ad group, its id `<adGroupId>~<term>`.
|
|
2385
|
+
*
|
|
2386
|
+
* - They read a daily history Zernio fetches from Google. A day keeps its 50,000 rows that spent most.
|
|
2387
|
+
* - Every daily window works, `today` included: today is refreshed at most once an hour.
|
|
2388
|
+
* - A new rule's first runs load its days a few at a time, and fail until all are in.
|
|
2389
|
+
* - Paused keywords are not judged.
|
|
2390
|
+
* - Google lists only what showed at least once, so `impressions` takes `>` or `>=`, never `<` or `<=`.
|
|
2391
|
+
*
|
|
2392
|
+
* They take `spend`, `impressions`, `clicks`, `conversions`, `ctr`, `cpc`, `cpm`, `cpa` and `roas` over whole days, no `usual`, `of`, `top` or `bottom`, and `compareTo` only as `campaign`. A keyword rule can `notify` or `pause`; a search term rule only notifies.
|
|
2393
|
+
*
|
|
2366
2394
|
*/
|
|
2367
|
-
export type AdRuleLevel = 'campaign' | 'adset' | 'ad';
|
|
2395
|
+
export type AdRuleLevel = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2368
2396
|
|
|
2369
2397
|
/**
|
|
2370
2398
|
* Turns matches into alerts. An object acts and notifies only after `confirmChecks` matching runs in a row; its alert stays open while it matches or `hold` holds, and resolves on its own (a day after the object stops delivering). Cooldown and caps still decide repeat actions.
|
|
@@ -2388,11 +2416,18 @@ export type AdRuleLifecycle = {
|
|
|
2388
2416
|
|
|
2389
2417
|
export type AdRuleObjectEvaluation = {
|
|
2390
2418
|
/**
|
|
2391
|
-
* Platform ID of the campaign or ad
|
|
2419
|
+
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{adGroupId}~{term}`.
|
|
2392
2420
|
*/
|
|
2393
2421
|
id: string;
|
|
2422
|
+
/**
|
|
2423
|
+
* The object's name: the keyword text or the search term.
|
|
2424
|
+
*/
|
|
2394
2425
|
name: string;
|
|
2395
2426
|
campaignId: (string) | null;
|
|
2427
|
+
/**
|
|
2428
|
+
* Absent on runs recorded before November 2026.
|
|
2429
|
+
*/
|
|
2430
|
+
campaignName?: (string) | null;
|
|
2396
2431
|
/**
|
|
2397
2432
|
* True when every condition holds.
|
|
2398
2433
|
*/
|
|
@@ -2433,12 +2468,19 @@ export type AdRuleRun = {
|
|
|
2433
2468
|
*
|
|
2434
2469
|
*/
|
|
2435
2470
|
outcome: 'triggered' | 'cooldown' | 'daily_limit' | 'no_match' | 'failed' | 'paused';
|
|
2471
|
+
/**
|
|
2472
|
+
* Objects the rule judged. 0 means its campaigns and filters matched nothing that is running.
|
|
2473
|
+
*/
|
|
2436
2474
|
objectsEvaluated: number;
|
|
2437
2475
|
actedObjectIds: Array<(string)>;
|
|
2438
2476
|
/**
|
|
2439
|
-
* The matched objects with their condition values, and what each action did.
|
|
2477
|
+
* The matched objects with their condition values, and what each action did. Null on a run that matched nothing, unless some objects could not be read.
|
|
2440
2478
|
*/
|
|
2441
2479
|
evaluation: {
|
|
2480
|
+
/**
|
|
2481
|
+
* On a run that matched nothing: how many objects had a condition whose value could not be read, so they could not match. A campaign with under 3 of the 4 previous weeks of data has no `usual` yet.
|
|
2482
|
+
*/
|
|
2483
|
+
unreadObjects?: number;
|
|
2442
2484
|
/**
|
|
2443
2485
|
* The rule as it was when this run happened, so its actions stay readable after the rule is renamed or deleted. Absent on runs recorded before October 2026.
|
|
2444
2486
|
*/
|
|
@@ -2448,7 +2490,7 @@ export type AdRuleRun = {
|
|
|
2448
2490
|
accountId?: string;
|
|
2449
2491
|
platform?: string;
|
|
2450
2492
|
platformAdAccountId?: string;
|
|
2451
|
-
level?: 'campaign' | 'adset';
|
|
2493
|
+
level?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2452
2494
|
};
|
|
2453
2495
|
today?: string;
|
|
2454
2496
|
timezone?: string;
|
|
@@ -2458,7 +2500,14 @@ export type AdRuleRun = {
|
|
|
2458
2500
|
* Where the run's hourly windows ended. Absent on runs recorded before November 2026.
|
|
2459
2501
|
*/
|
|
2460
2502
|
hourlyThrough?: (string) | null;
|
|
2503
|
+
/**
|
|
2504
|
+
* The matched objects, at most 200. `matchedTotal` has the full count.
|
|
2505
|
+
*/
|
|
2461
2506
|
matched?: Array<AdRuleObjectEvaluation>;
|
|
2507
|
+
/**
|
|
2508
|
+
* How many objects matched, including those past the 200 recorded. Absent on runs recorded before November 2026.
|
|
2509
|
+
*/
|
|
2510
|
+
matchedTotal?: number;
|
|
2462
2511
|
actions?: Array<{
|
|
2463
2512
|
objectId: string;
|
|
2464
2513
|
type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
|
|
@@ -2495,6 +2544,8 @@ export type AdRuleRun = {
|
|
|
2495
2544
|
error: (string) | null;
|
|
2496
2545
|
};
|
|
2497
2546
|
|
|
2547
|
+
export type level2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2548
|
+
|
|
2498
2549
|
/**
|
|
2499
2550
|
* Either `everyMinutes` or `times`. Sending a schedule replaces the rule's whole timing. Without one, a new rule runs every 60 minutes.
|
|
2500
2551
|
*/
|
|
@@ -2581,7 +2632,7 @@ export type kind = 'ad_rejected' | 'delivery_issue' | 'payment' | 'budget_limite
|
|
|
2581
2632
|
|
|
2582
2633
|
export type severity = 'error' | 'warning' | 'info';
|
|
2583
2634
|
|
|
2584
|
-
export type
|
|
2635
|
+
export type level3 = 'ad_account' | 'campaign' | 'ad_set' | 'ad';
|
|
2585
2636
|
|
|
2586
2637
|
/**
|
|
2587
2638
|
* One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.
|
|
@@ -3728,7 +3779,7 @@ export type AutomationAction = AutomationActionResult & {
|
|
|
3728
3779
|
automationName: string;
|
|
3729
3780
|
checkId: string;
|
|
3730
3781
|
subject: {
|
|
3731
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
3782
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
3732
3783
|
id?: string;
|
|
3733
3784
|
name?: (string) | null;
|
|
3734
3785
|
};
|
|
@@ -3741,7 +3792,7 @@ export type AutomationAction = AutomationActionResult & {
|
|
|
3741
3792
|
createdAt: string;
|
|
3742
3793
|
};
|
|
3743
3794
|
|
|
3744
|
-
export type kind2 = 'campaign' | 'adset' | 'ad';
|
|
3795
|
+
export type kind2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
3745
3796
|
|
|
3746
3797
|
/**
|
|
3747
3798
|
* What an ad rule did to one object, as an absolute change: a budget change reads as the budget it set.
|
|
@@ -3818,6 +3869,18 @@ export type AutomationAdFilter = {
|
|
|
3818
3869
|
field: "channel_type";
|
|
3819
3870
|
op: 'in' | 'not_in';
|
|
3820
3871
|
values: Array<('SEARCH' | 'DISPLAY' | 'SHOPPING' | 'HOTEL' | 'VIDEO' | 'MULTI_CHANNEL' | 'LOCAL' | 'SMART' | 'PERFORMANCE_MAX' | 'LOCAL_SERVICES' | 'TRAVEL' | 'DEMAND_GEN')>;
|
|
3872
|
+
} | {
|
|
3873
|
+
field: "match_type";
|
|
3874
|
+
op: 'in' | 'not_in';
|
|
3875
|
+
values: Array<('EXACT' | 'PHRASE' | 'BROAD')>;
|
|
3876
|
+
} | {
|
|
3877
|
+
field: "search_term_status";
|
|
3878
|
+
op: 'in' | 'not_in';
|
|
3879
|
+
values: Array<('ADDED' | 'EXCLUDED' | 'ADDED_EXCLUDED' | 'NONE')>;
|
|
3880
|
+
} | {
|
|
3881
|
+
field: "blocked_by_negative";
|
|
3882
|
+
op: "equals";
|
|
3883
|
+
value: boolean;
|
|
3821
3884
|
};
|
|
3822
3885
|
|
|
3823
3886
|
export type field = 'name' | 'campaign_name' | 'adset_name' | 'goal';
|
|
@@ -3885,7 +3948,7 @@ export type status7 = 'pending' | 'approved' | 'rejected' | 'expired' | 'cancell
|
|
|
3885
3948
|
export type AutomationApprovalChange = {
|
|
3886
3949
|
actionId: string;
|
|
3887
3950
|
subject: {
|
|
3888
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
3951
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
3889
3952
|
id: string;
|
|
3890
3953
|
name: (string) | null;
|
|
3891
3954
|
};
|
|
@@ -4037,7 +4100,7 @@ export type AutomationBacktestDay = {
|
|
|
4037
4100
|
heldBack: number;
|
|
4038
4101
|
actions: Array<{
|
|
4039
4102
|
subject: {
|
|
4040
|
-
kind: 'campaign' | 'adset' | 'ad';
|
|
4103
|
+
kind: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4041
4104
|
id: string;
|
|
4042
4105
|
name: string;
|
|
4043
4106
|
campaignId: (string) | null;
|
|
@@ -4334,7 +4397,7 @@ export type AutomationPreview = {
|
|
|
4334
4397
|
*/
|
|
4335
4398
|
subjects: Array<{
|
|
4336
4399
|
subject: {
|
|
4337
|
-
kind?: 'campaign' | 'adset' | 'ad';
|
|
4400
|
+
kind?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4338
4401
|
/**
|
|
4339
4402
|
* Platform ID.
|
|
4340
4403
|
*/
|
|
@@ -4576,7 +4639,7 @@ export type AutomationSubjects = {
|
|
|
4576
4639
|
/**
|
|
4577
4640
|
* The objects judged one by one.
|
|
4578
4641
|
*/
|
|
4579
|
-
each: 'campaign' | 'adset' | 'ad';
|
|
4642
|
+
each: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4580
4643
|
/**
|
|
4581
4644
|
* The ad account to check. One per ad rule, and an edit cannot move it to another.
|
|
4582
4645
|
*/
|
|
@@ -4618,7 +4681,7 @@ export type AutomationSubjects = {
|
|
|
4618
4681
|
/**
|
|
4619
4682
|
* The objects judged one by one.
|
|
4620
4683
|
*/
|
|
4621
|
-
export type each = 'campaign' | 'adset' | 'ad';
|
|
4684
|
+
export type each = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
4622
4685
|
|
|
4623
4686
|
export type AutomationTemplate = {
|
|
4624
4687
|
/**
|
|
@@ -13077,7 +13140,7 @@ export type GoogleListingGroupDimension = {
|
|
|
13077
13140
|
};
|
|
13078
13141
|
};
|
|
13079
13142
|
|
|
13080
|
-
export type
|
|
13143
|
+
export type level4 = 'LEVEL1' | 'LEVEL2' | 'LEVEL3' | 'LEVEL4' | 'LEVEL5';
|
|
13081
13144
|
|
|
13082
13145
|
export type condition = 'NEW' | 'REFURBISHED' | 'USED';
|
|
13083
13146
|
|
|
@@ -21619,7 +21682,7 @@ export type event10 = 'ad.created';
|
|
|
21619
21682
|
/**
|
|
21620
21683
|
* Always `AD`.
|
|
21621
21684
|
*/
|
|
21622
|
-
export type
|
|
21685
|
+
export type level5 = 'AD';
|
|
21623
21686
|
|
|
21624
21687
|
/**
|
|
21625
21688
|
* Where the ad was created. `zernio` for ads created through Zernio, `platform` for ads the sync detected.
|
|
@@ -21789,9 +21852,9 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
21789
21852
|
id: string;
|
|
21790
21853
|
name: string;
|
|
21791
21854
|
/**
|
|
21792
|
-
* Whether the rule evaluates campaigns, ad sets or
|
|
21855
|
+
* Whether the rule evaluates campaigns, ad sets, ads, Google keywords or Google search terms.
|
|
21793
21856
|
*/
|
|
21794
|
-
level: 'campaign' | 'adset' | 'ad';
|
|
21857
|
+
level: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
21795
21858
|
/**
|
|
21796
21859
|
* Platform-native ad account ID the rule watches.
|
|
21797
21860
|
*/
|
|
@@ -21932,11 +21995,6 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
21932
21995
|
|
|
21933
21996
|
export type event13 = 'ad_rule.triggered';
|
|
21934
21997
|
|
|
21935
|
-
/**
|
|
21936
|
-
* Whether the rule evaluates campaigns, ad sets or ads.
|
|
21937
|
-
*/
|
|
21938
|
-
export type level5 = 'campaign' | 'adset' | 'ad';
|
|
21939
|
-
|
|
21940
21998
|
/**
|
|
21941
21999
|
* Webhook payload for the `ad_set.created` event. Fires when an ad set is created through Zernio (API, MCP or dashboard) or detected by the sync, once per ad set, after its row is recorded so `GET /v1/ads/ad-sets/{adSetId}` finds it.
|
|
21942
22000
|
*
|
|
@@ -59916,7 +59974,7 @@ export type GetAutomationCatalogResponse = ({
|
|
|
59916
59974
|
* Ad rule subjects.
|
|
59917
59975
|
*/
|
|
59918
59976
|
subjects: Array<{
|
|
59919
|
-
each?: 'campaign' | 'adset' | 'ad';
|
|
59977
|
+
each?: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
59920
59978
|
platforms?: Array<(string)>;
|
|
59921
59979
|
metrics?: Array<{
|
|
59922
59980
|
metric?: string;
|
|
@@ -60566,7 +60624,7 @@ export type CreateAdRuleData = {
|
|
|
60566
60624
|
adAccountId: string;
|
|
60567
60625
|
level: AdRuleLevel;
|
|
60568
60626
|
/**
|
|
60569
|
-
* Only check these platform campaign IDs (or
|
|
60627
|
+
* Only check these platform campaign IDs (or what sits in them). Leave out to check the whole ad account.
|
|
60570
60628
|
*/
|
|
60571
60629
|
campaignIds?: Array<(string)>;
|
|
60572
60630
|
filters?: AdRuleFilters;
|