Skip to content

Commit 5300065

Browse files
authored
Google Ads - update to api v18 (#15591)
* update to api v18 * pnpm-lock.yaml * update userListId prop
1 parent 6e2214c commit 5300065

File tree

12 files changed

+50
-49
lines changed

12 files changed

+50
-49
lines changed

components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "google_ads-add-contact-to-list-by-email",
88
name: "Add Contact to Customer List by Email",
99
description: "Adds a contact to a specific customer list in Google Ads. Lists typically update in 6 to 12 hours after operation. [See the documentation](https://developers.google.com/google-ads/api/docs/remarketing/audience-segments/customer-match/get-started)",
10-
version: "0.1.1",
10+
version: "0.1.2",
1111
type: "action",
1212
props: {
1313
...common.props,

components/google_ads/actions/common/props.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DEFAULT_DOCS =
2-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList";
2+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList";
33

44
export const getAdditionalFields = (docsLink = DEFAULT_DOCS) => ({
55
type: "object",

components/google_ads/actions/create-customer-list/common-constants.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const USER_LIST_CRM_BASED_PROPS = {
5757
type: "string",
5858
label: "App ID",
5959
description:
60-
"A string that uniquely identifies a mobile application from which the data was collected. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#CrmBasedUserListInfo) for more details.",
60+
"A string that uniquely identifies a mobile application from which the data was collected. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#CrmBasedUserListInfo) for more details.",
6161
optional: true,
6262
},
6363
};
@@ -74,7 +74,7 @@ const USER_LIST_RULE_BASED_PROPS = {
7474
type: "object",
7575
label: "Flexible Rule Customer List",
7676
description:
77-
"Flexible rule representation of visitors with one or multiple actions. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#FlexibleRuleUserListInfo) on how to build this object. Values will be parsed as JSON where applicable.",
77+
"Flexible rule representation of visitors with one or multiple actions. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#FlexibleRuleUserListInfo) on how to build this object. Values will be parsed as JSON where applicable.",
7878
optional: true,
7979
},
8080
};
@@ -84,15 +84,15 @@ const USER_LIST_LOGICAL_PROPS = {
8484
type: "string[]",
8585
label: "Rules",
8686
description:
87-
"Logical list rules that define this customer list. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#UserListLogicalRuleInfo) on how to build each object. Values will be parsed as JSON where applicable.",
87+
"Logical list rules that define this customer list. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#UserListLogicalRuleInfo) on how to build each object. Values will be parsed as JSON where applicable.",
8888
},
8989
};
9090

9191
const USER_LIST_BASIC_PROPS = {
9292
conversionActions: {
9393
type: "string[]",
9494
label: "Conversion action(s)",
95-
description: "One or more [conversion actions](https://developers.google.com/google-ads/api/rest/reference/rest/v16/ConversionAction) to build the list with.",
95+
description: "One or more [conversion actions](https://developers.google.com/google-ads/api/rest/reference/rest/v18/ConversionAction) to build the list with.",
9696
optional: true,
9797
options: async() => {
9898
const {
@@ -115,7 +115,7 @@ const USER_LIST_BASIC_PROPS = {
115115
remarketingActions: {
116116
type: "string[]",
117117
label: "Remarketing action(s)",
118-
description: "One or more [remarketing actions](https://developers.google.com/google-ads/api/rest/reference/rest/v16/RemarketingAction).",
118+
description: "One or more [remarketing actions](https://developers.google.com/google-ads/api/rest/reference/rest/v18/RemarketingAction).",
119119
optional: true,
120120
options: async() => {
121121
const {
@@ -198,37 +198,37 @@ export const USER_LIST_TYPE_OPTIONS = [
198198
label: "CRM-based - a list of provided customers",
199199
value: USER_LIST_TYPES.CRM_BASED,
200200
docsLink:
201-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#CrmBasedUserListInfo",
201+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#CrmBasedUserListInfo",
202202
props: USER_LIST_CRM_BASED_PROPS,
203203
},
204204
{
205205
label: "Rule-Based - a customer list generated by a rule",
206206
value: USER_LIST_TYPES.RULE_BASED,
207207
docsLink:
208-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#RuleBasedUserListInfo",
208+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#RuleBasedUserListInfo",
209209
props: USER_LIST_RULE_BASED_PROPS,
210210
},
211211
{
212212
label: "Logical - a custom combination of customer lists",
213213
value: USER_LIST_TYPES.LOGICAL,
214214
docsLink:
215-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#LogicalUserListInfo",
215+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#LogicalUserListInfo",
216216
props: USER_LIST_LOGICAL_PROPS,
217217
},
218218
{
219219
label:
220220
"Basic - a customer list targeting as a collection of conversions or remarketing actions",
221221
value: USER_LIST_TYPES.BASIC,
222222
docsLink:
223-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#BasicUserListInfo",
223+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#BasicUserListInfo",
224224
props: USER_LIST_BASIC_PROPS,
225225
},
226226
{
227227
label:
228228
"Lookalike - a list composed of customers similar to those of a configurable seed",
229229
value: USER_LIST_TYPES.LOOKALIKE,
230230
docsLink:
231-
"https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#LookalikeUserListInfo",
231+
"https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#LookalikeUserListInfo",
232232
props: USER_LIST_LOOKALIKE_PROPS,
233233
},
234234
];

components/google_ads/actions/create-customer-list/create-customer-list.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ export default {
1414
...common,
1515
key: "google_ads-create-customer-list",
1616
name: "Create Customer List",
17-
description:
18-
"Create a new customer list in Google Ads. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList)",
19-
version: "0.0.2",
17+
description: "Create a new customer list in Google Ads. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList)",
18+
version: "0.0.3",
2019
type: "action",
2120
props: {
2221
...common.props,
@@ -34,8 +33,7 @@ export default {
3433
listType: {
3534
type: "string",
3635
label: "List Type",
37-
description:
38-
"The [type of customer list](https://developers.google.com/google-ads/api/rest/reference/rest/v16/UserList#CrmBasedUserListInfo) to create.",
36+
description: "The [type of customer list](https://developers.google.com/google-ads/api/rest/reference/rest/v18/UserList#CrmBasedUserListInfo) to create.",
3937
options: USER_LIST_TYPE_OPTIONS.map(({
4038
label, value,
4139
}) => ({
@@ -95,6 +93,10 @@ export default {
9593
additionalProps() {
9694
const { listType } = this;
9795

96+
if (!listType) {
97+
return {};
98+
}
99+
98100
const option = USER_LIST_TYPE_OPTIONS.find(
99101
({ value }) => value === listType,
100102
);

components/google_ads/actions/create-report/create-report.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default {
1818
...common,
1919
key: "google_ads-create-report",
2020
name: "Create Report",
21-
description: "Generates a report from your Google Ads data. [See the documentation](https://developers.google.com/google-ads/api/fields/v16/overview)",
22-
version: "0.1.0",
21+
description: "Generates a report from your Google Ads data. [See the documentation](https://developers.google.com/google-ads/api/fields/v18/overview)",
22+
version: "0.1.1",
2323
type: "action",
2424
props: {
2525
...common.props,
@@ -43,7 +43,7 @@ export default {
4343
docsAlert: {
4444
type: "alert",
4545
alertType: "info",
46-
content: `[See the documentation](https://developers.google.com/google-ads/api/fields/v16/${value}) for more information on available fields, segments and metrics.`,
46+
content: `[See the documentation](https://developers.google.com/google-ads/api/fields/v18/${value}) for more information on available fields, segments and metrics.`,
4747
},
4848
objectFilter: {
4949
type: "string[]",
@@ -106,7 +106,7 @@ export default {
106106
segments: {
107107
type: "string[]",
108108
label: "Segments",
109-
description: "Select any segments you want to include in your report. See the documentation [here](https://developers.google.com/google-ads/api/fields/v16/segments)",
109+
description: "Select any segments you want to include in your report. See the documentation [here](https://developers.google.com/google-ads/api/fields/v18/segments)",
110110
options: resource.segments,
111111
default: [
112112
"segments.date",
@@ -117,7 +117,7 @@ export default {
117117
metrics: {
118118
type: "string[]",
119119
label: "Metrics",
120-
description: "Select any metrics you want to include in your report. See the documentation [here](https://developers.google.com/google-ads/api/fields/v16/metrics)",
120+
description: "Select any metrics you want to include in your report. See the documentation [here](https://developers.google.com/google-ads/api/fields/v18/metrics)",
121121
options: resource.metrics,
122122
optional: true,
123123
reloadProps: true,

components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default {
77
...common,
88
key: "google_ads-send-offline-conversion",
99
name: "Send Offline Conversion",
10-
description: "Send an event from to Google Ads to track offline conversions. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v16/ConversionAction)",
11-
version: "0.0.2",
10+
description: "Send an event from to Google Ads to track offline conversions. [See the documentation](https://developers.google.com/google-ads/api/rest/reference/rest/v18/ConversionAction)",
11+
version: "0.0.3",
1212
type: "action",
1313
props: {
1414
...common.props,
@@ -20,10 +20,10 @@ export default {
2020
type: {
2121
type: "string",
2222
label: "Type",
23-
description: "[The type](https://developers.google.com/google-ads/api/rest/reference/rest/v16/ConversionAction#ConversionActionType) of the conversion action.",
23+
description: "[The type](https://developers.google.com/google-ads/api/rest/reference/rest/v18/ConversionAction#ConversionActionType) of the conversion action.",
2424
options: CONVERSION_TYPE_OPTIONS,
2525
},
26-
additionalFields: getAdditionalFields("https://developers.google.com/google-ads/api/rest/reference/rest/v16/ConversionAction"),
26+
additionalFields: getAdditionalFields("https://developers.google.com/google-ads/api/rest/reference/rest/v18/ConversionAction"),
2727
},
2828
async run({ $ }) {
2929
const {

components/google_ads/common/queries.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function listUserLists() {
2020
const fields = [
2121
"id",
2222
"name",
23+
"type",
2324
].map((s) => `user_list.${s}`).join(", ");
2425

2526
return `SELECT ${fields} FROM user_list`;

components/google_ads/google_ads.app.mjs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
accountId,
2222
customerClientId,
2323
});
24-
return response?.map(({
24+
return response?.filter(({ userList: { type } }) => type === "CRM_BASED")?.map(({
2525
userList: {
2626
id, name,
2727
},
@@ -34,7 +34,7 @@ export default {
3434
accountId: {
3535
type: "string",
3636
label: "Use Google Ads As",
37-
description: "Select an account from the list of [customers directly accessible by the authenticated user](https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/listAccessibleCustomers). This is usually a **Manager Account**, used as `login-customer-id`",
37+
description: "Select an account from the list of [customers directly accessible by the authenticated user](https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers/listAccessibleCustomers). This is usually a **Manager Account**, used as `login-customer-id`",
3838
async options() {
3939
const response = await this.listAccessibleCustomers();
4040
return response?.map(((resourceName) => ({
@@ -46,7 +46,7 @@ export default {
4646
customerClientId: {
4747
type: "string",
4848
label: "Managed Account",
49-
description: "Select a [customer client](https://developers.google.com/google-ads/api/reference/rpc/v16/CustomerClient) from the list of [customers linked to the selected account](https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy).",
49+
description: "Select a [customer client](https://developers.google.com/google-ads/api/reference/rpc/v18/CustomerClient) from the list of [customers linked to the selected account](https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy).",
5050
useQuery: true,
5151
optional: true,
5252
async options({
@@ -71,7 +71,7 @@ export default {
7171
leadFormId: {
7272
type: "string",
7373
label: "Lead Form ID",
74-
description: "Select a [Lead Form](https://developers.google.com/google-ads/api/rest/reference/rest/v16/Asset#LeadFormAsset) to watch for new entries.",
74+
description: "Select a [Lead Form](https://developers.google.com/google-ads/api/rest/reference/rest/v18/Asset#LeadFormAsset) to watch for new entries.",
7575
async options({
7676
accountId, customerClientId,
7777
}) {
@@ -121,7 +121,7 @@ export default {
121121
}) {
122122
console.log("Executing query: ", query);
123123
const response = await this._makeRequest({
124-
path: "/v16/customers/{customerClientId}/googleAds:search",
124+
path: "/v18/customers/{customerClientId}/googleAds:search",
125125
method: "post",
126126
data: {
127127
query,
@@ -132,7 +132,7 @@ export default {
132132
},
133133
async listAccessibleCustomers() {
134134
const response = await this._makeRequest({
135-
path: "/v16/customers:listAccessibleCustomers",
135+
path: "/v18/customers:listAccessibleCustomers",
136136
});
137137
return response.resourceNames;
138138
},
@@ -151,7 +151,7 @@ export default {
151151
},
152152
async createUserList(args) {
153153
const response = await this._makeRequest({
154-
path: "v16/customers/{customerClientId}/userLists:mutate",
154+
path: "v18/customers/{customerClientId}/userLists:mutate",
155155
method: "post",
156156
...args,
157157
});
@@ -200,7 +200,6 @@ export default {
200200
return this.search({
201201
query: QUERIES.listResources(resource, query),
202202
params: {
203-
pageSize: 100,
204203
pageToken,
205204
},
206205
...args,
@@ -217,7 +216,7 @@ export default {
217216
},
218217
async createConversionAction(args) {
219218
const response = await this._makeRequest({
220-
path: "v16/customers/{customerClientId}/conversionActions:mutate",
219+
path: "v18/customers/{customerClientId}/conversionActions:mutate",
221220
method: "post",
222221
...args,
223222
});
@@ -228,14 +227,14 @@ export default {
228227
}) {
229228
return this._makeRequest({
230229
method: "POST",
231-
path: `/v16/${path}:addOperations`,
230+
path: `/v18/${path}:addOperations`,
232231
...opts,
233232
});
234233
},
235234
async createOfflineUserDataJob(opts = {}) {
236235
return this._makeRequest({
237236
method: "POST",
238-
path: "/v16/customers/{customerClientId}/offlineUserDataJobs:create",
237+
path: "/v18/customers/{customerClientId}/offlineUserDataJobs:create",
239238
...opts,
240239
});
241240
},
@@ -244,7 +243,7 @@ export default {
244243
}) {
245244
return this._makeRequest({
246245
method: "POST",
247-
path: `/v16/${path}:run`,
246+
path: `/v18/${path}:run`,
248247
...args,
249248
});
250249
},

components/google_ads/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/google_ads",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Pipedream Google Ads Components",
55
"main": "google_ads.app.mjs",
66
"keywords": [
@@ -13,7 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.6.5",
16+
"@pipedream/platform": "^3.0.3",
1717
"crypto": "^1.0.1"
1818
}
1919
}

components/google_ads/sources/new-campaign-created/new-campaign-created.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ export default {
66
...common,
77
key: "google_ads-new-campaign-created",
88
name: "New Campaign Created",
9-
description: "Emit new event when a new campaign is created. [See the documentation](https://developers.google.com/google-ads/api/fields/v16/campaign)",
10-
version: "0.0.2",
9+
description: "Emit new event when a new campaign is created. [See the documentation](https://developers.google.com/google-ads/api/fields/v18/campaign)",
10+
version: "0.0.3",
1111
type: "source",
1212
dedupe: "unique",
1313
sampleEmit,
1414
props: {
1515
...common.props,
1616
customerClientId: {
1717
...common.props.customerClientId,
18-
optional: false,
1918
},
2019
fields: {
2120
type: "string[]",
2221
label: "Extra Fields",
23-
description: "Additional [campaign fields](https://developers.google.com/google-ads/api/fields/v16/campaign) to emit in the event",
22+
description: "Additional [campaign fields](https://developers.google.com/google-ads/api/fields/v18/campaign) to emit in the event",
2423
options: campaign.fields,
2524
optional: true,
2625
default: [

0 commit comments

Comments
 (0)