@pipedream/google_ads 0.5.0 → 0.7.0
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/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs +1 -1
- package/actions/create-ad-group-report/create-ad-group-report.mjs +1 -1
- package/actions/create-ad-report/create-ad-report.mjs +1 -1
- package/actions/create-campaign-report/create-campaign-report.mjs +1 -1
- package/actions/create-customer-list/create-customer-list.mjs +1 -1
- package/actions/create-customer-report/create-customer-report.mjs +1 -1
- package/actions/create-report/create-report.mjs +123 -121
- package/actions/generate-keyword-ideas/generate-keyword-ideas.mjs +1 -1
- package/actions/list-account-id-options/list-account-id-options.mjs +24 -0
- package/actions/list-customer-clients/list-customer-clients.mjs +43 -0
- package/actions/send-offline-conversion/send-offline-conversion.mjs +1 -1
- package/google_ads.app.mjs +2 -2
- package/package.json +1 -1
- package/sources/new-campaign-created/new-campaign-created.mjs +1 -1
- package/sources/new-lead-form-entry/new-lead-form-entry.mjs +1 -1
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_ads-add-contact-to-list-by-email",
|
|
8
8
|
name: "Add Contact to Customer List by Email",
|
|
9
9
|
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.
|
|
10
|
+
version: "0.1.8",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: true,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_ads-create-ad-group-report",
|
|
7
7
|
name: "Create Ad Group Report",
|
|
8
8
|
description: "Creates a report for the Ad Group resource. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.2",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_ads-create-ad-report",
|
|
7
7
|
name: "Create Ad Report",
|
|
8
8
|
description: "Creates a report for the Ad resource. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.2",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_ads-create-campaign-report",
|
|
7
7
|
name: "Create Campaign Report",
|
|
8
8
|
description: "Creates a report for the Campaign resource. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.2",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
key: "google_ads-create-customer-list",
|
|
16
16
|
name: "Create Customer List",
|
|
17
17
|
description: "Create a new customer list in Google Ads. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/UserList)",
|
|
18
|
-
version: "0.0.
|
|
18
|
+
version: "0.0.9",
|
|
19
19
|
annotations: {
|
|
20
20
|
destructiveHint: false,
|
|
21
21
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_ads-create-customer-report",
|
|
7
7
|
name: "Create Customer Report",
|
|
8
8
|
description: "Creates a report for the Customer resource. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.2",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
key: "google_ads-create-report",
|
|
21
21
|
name: "Create Report",
|
|
22
22
|
description: "Generates a report from your Google Ads data. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
23
|
-
version: "0.
|
|
23
|
+
version: "0.2.0",
|
|
24
24
|
annotations: {
|
|
25
25
|
destructiveHint: false,
|
|
26
26
|
openWorldHint: true,
|
|
@@ -34,106 +34,100 @@ export default {
|
|
|
34
34
|
label: "Resource",
|
|
35
35
|
description: "The resource to generate a report for.",
|
|
36
36
|
options: RESOURCES.map((r) => r.resourceOption),
|
|
37
|
-
reloadProps: true,
|
|
38
37
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} = await this.googleAds.listResources({
|
|
69
|
-
accountId,
|
|
70
|
-
customerClientId,
|
|
71
|
-
resource,
|
|
72
|
-
query,
|
|
73
|
-
pageToken,
|
|
74
|
-
});
|
|
75
|
-
const options = results?.map?.((item) => this.getResourceOption(item, resource));
|
|
76
|
-
return {
|
|
77
|
-
options,
|
|
78
|
-
context: {
|
|
79
|
-
nextPageToken,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
dateRange: {
|
|
85
|
-
type: "string",
|
|
86
|
-
label: "Date Range",
|
|
87
|
-
description: "Select a date range for the report",
|
|
88
|
-
options: DATE_RANGE_OPTIONS,
|
|
89
|
-
optional: true,
|
|
90
|
-
reloadProps: true,
|
|
38
|
+
objectFilter: {
|
|
39
|
+
type: "string[]",
|
|
40
|
+
label: "Filter by Resources",
|
|
41
|
+
description: "Google Ads resource IDs to limit the report to. Pass a string array of numeric IDs (e.g. `[\"1234567890\", \"9876543210\"]`). Omit to include all resources.",
|
|
42
|
+
optional: true,
|
|
43
|
+
useQuery: true,
|
|
44
|
+
async options({
|
|
45
|
+
query, prevContext = {},
|
|
46
|
+
}) {
|
|
47
|
+
const { nextPageToken: pageToken } = prevContext;
|
|
48
|
+
const {
|
|
49
|
+
accountId, customerClientId, resource,
|
|
50
|
+
} = this;
|
|
51
|
+
const {
|
|
52
|
+
results, nextPageToken,
|
|
53
|
+
} = await this.googleAds.listResources({
|
|
54
|
+
accountId,
|
|
55
|
+
customerClientId,
|
|
56
|
+
resource,
|
|
57
|
+
query,
|
|
58
|
+
pageToken,
|
|
59
|
+
});
|
|
60
|
+
const options = results?.map?.((item) => this.getResourceOption(item, resource));
|
|
61
|
+
return {
|
|
62
|
+
options,
|
|
63
|
+
context: {
|
|
64
|
+
nextPageToken,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
91
67
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
68
|
+
},
|
|
69
|
+
dateRange: {
|
|
70
|
+
type: "string",
|
|
71
|
+
label: "Date Range",
|
|
72
|
+
description: "Predefined Google Ads date range keyword (e.g. `LAST_30_DAYS`, `THIS_MONTH`). For a custom range, use `CUSTOM` with `startDate` and `endDate` in `YYYY-MM-DD` format (e.g. `2024-01-01`, `2024-01-31`).",
|
|
73
|
+
options: DATE_RANGE_OPTIONS,
|
|
74
|
+
optional: true,
|
|
75
|
+
},
|
|
76
|
+
startDate: {
|
|
77
|
+
type: "string",
|
|
78
|
+
label: "Start Date",
|
|
79
|
+
description: "The start date in `YYYY-MM-DD` format (e.g. `2024-01-01`). Only relevant if `Date Range` is set to `CUSTOM`.",
|
|
80
|
+
optional: true,
|
|
81
|
+
},
|
|
82
|
+
endDate: {
|
|
83
|
+
type: "string",
|
|
84
|
+
label: "End Date",
|
|
85
|
+
description: "The end date in `YYYY-MM-DD` format (e.g. `2024-01-31`). Only relevant if `Date Range` is set to `CUSTOM`.",
|
|
86
|
+
optional: true,
|
|
87
|
+
},
|
|
88
|
+
fields: {
|
|
89
|
+
type: "string[]",
|
|
90
|
+
label: "Fields",
|
|
91
|
+
description: "Resource field names for the GAQL SELECT clause. Pass a string array (e.g. `[\"id\", \"name\"]` or `[\"campaign.id\", \"campaign.name\"]` for campaign reports).",
|
|
92
|
+
options() {
|
|
93
|
+
const resource = RESOURCES.find((r) => r.resourceOption.value === this.resource);
|
|
94
|
+
if (!resource) throw new ConfigurationError("Select one of the available resources.");
|
|
95
|
+
return resource.fields;
|
|
111
96
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
97
|
+
optional: true,
|
|
98
|
+
},
|
|
99
|
+
segments: {
|
|
100
|
+
type: "string[]",
|
|
101
|
+
label: "Segments",
|
|
102
|
+
description: "Segment field names to include (e.g. `[\"date\"]` or `[\"segments.date\"]`). See the documentation [here](https://developers.google.com/google-ads/api/reference/rpc/v21/Segments).",
|
|
103
|
+
options() {
|
|
104
|
+
const resource = RESOURCES.find((r) => r.resourceOption.value === this.resource);
|
|
105
|
+
if (!resource) throw new ConfigurationError("Select one of the available resources.");
|
|
106
|
+
return resource.segments;
|
|
122
107
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
108
|
+
default: [
|
|
109
|
+
"segments.date",
|
|
110
|
+
],
|
|
111
|
+
optional: true,
|
|
112
|
+
},
|
|
113
|
+
metrics: {
|
|
114
|
+
type: "string[]",
|
|
115
|
+
label: "Metrics",
|
|
116
|
+
description: "Metric field names to include (e.g. `[\"impressions\", \"clicks\"]` or `[\"metrics.impressions\", \"metrics.clicks\"]`). See the documentation [here](https://developers.google.com/google-ads/api/reference/rpc/v21/Metrics).",
|
|
117
|
+
options() {
|
|
118
|
+
const resource = RESOURCES.find((r) => r.resourceOption.value === this.resource);
|
|
119
|
+
if (!resource) throw new ConfigurationError("Select one of the available resources.");
|
|
120
|
+
return resource.metrics;
|
|
130
121
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
orderBy: {
|
|
125
|
+
type: "string",
|
|
126
|
+
label: "Order By",
|
|
127
|
+
description: "The field to order the results by",
|
|
128
|
+
optional: true,
|
|
129
|
+
options() {
|
|
130
|
+
return [
|
|
137
131
|
this.fields,
|
|
138
132
|
this.segments,
|
|
139
133
|
this.metrics,
|
|
@@ -147,32 +141,32 @@ export default {
|
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
143
|
return returnValue?.map?.((str) => str.trim());
|
|
150
|
-
})
|
|
144
|
+
});
|
|
151
145
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
146
|
+
},
|
|
147
|
+
direction: {
|
|
148
|
+
type: "string",
|
|
149
|
+
label: "Direction",
|
|
150
|
+
description: "The direction to order the results by, if `Order By` is specified",
|
|
151
|
+
optional: true,
|
|
152
|
+
options: [
|
|
153
|
+
{
|
|
154
|
+
label: "Ascending",
|
|
155
|
+
value: "ASC",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: "Descending",
|
|
159
|
+
value: "DESC",
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
default: "ASC",
|
|
163
|
+
},
|
|
164
|
+
limit: {
|
|
165
|
+
type: "integer",
|
|
166
|
+
label: "Limit",
|
|
167
|
+
description: "The maximum number of results to return",
|
|
168
|
+
optional: true,
|
|
169
|
+
},
|
|
176
170
|
},
|
|
177
171
|
methods: {
|
|
178
172
|
getResourceOption(item, resource) {
|
|
@@ -249,6 +243,14 @@ export default {
|
|
|
249
243
|
},
|
|
250
244
|
},
|
|
251
245
|
async run({ $ }) {
|
|
246
|
+
if (!RESOURCES.find((r) => r.resourceOption.value === this.resource)) {
|
|
247
|
+
throw new ConfigurationError("Select one of the available resources.");
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (this.dateRange === "CUSTOM" && (!this.startDate || !this.endDate)) {
|
|
251
|
+
throw new ConfigurationError("Start and end dates are required if using a custom date range.");
|
|
252
|
+
}
|
|
253
|
+
|
|
252
254
|
const query = this.buildQuery();
|
|
253
255
|
const results = (await this.googleAds.createReport({
|
|
254
256
|
$,
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
key: "google_ads-generate-keyword-ideas",
|
|
10
10
|
name: "Generate Keyword Ideas",
|
|
11
11
|
description: `Generate keyword ideas using the Google Ads API. [See the documentation](${docLink})`,
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.3",
|
|
13
13
|
type: "action",
|
|
14
14
|
annotations: {
|
|
15
15
|
destructiveHint: false,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import google_ads from "../../google_ads.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_ads-list-account-id-options",
|
|
5
|
+
name: "List Account ID Options",
|
|
6
|
+
description: "Retrieves available options for the Account ID field.",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
google_ads,
|
|
16
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const options = await google_ads.propDefinitions.accountId.options.call(this.google_ads);
|
|
19
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
|
+
? ""
|
|
21
|
+
: "s"}`);
|
|
22
|
+
return options;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import googleAds from "../../google_ads.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_ads-list-customer-clients",
|
|
5
|
+
name: "List Customer Clients",
|
|
6
|
+
description: "List all customer clients for a given account. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleAds,
|
|
16
|
+
accountId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleAds,
|
|
19
|
+
"accountId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
query: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Query",
|
|
25
|
+
description: "Partial match text for the customer client descriptive name (e.g. `Acme` matches names containing \"Acme\"). Omit to return clients up to level 3.",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
async run({ $ }) {
|
|
30
|
+
const response = await this.googleAds.listCustomerClients({
|
|
31
|
+
$,
|
|
32
|
+
accountId: this.accountId,
|
|
33
|
+
query: this.query,
|
|
34
|
+
});
|
|
35
|
+
const clients = Array.isArray(response)
|
|
36
|
+
? response
|
|
37
|
+
: [];
|
|
38
|
+
$.export("$summary", `Successfully retrieved ${clients.length} customer client${clients.length === 1
|
|
39
|
+
? ""
|
|
40
|
+
: "s"}`);
|
|
41
|
+
return clients;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "google_ads-send-offline-conversion",
|
|
9
9
|
name: "Send Offline Conversion",
|
|
10
10
|
description: "Send an event to Google Ads to track offline conversions. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/ConversionAction)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.9",
|
|
12
12
|
annotations: {
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
openWorldHint: true,
|
package/google_ads.app.mjs
CHANGED
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
accountId: {
|
|
37
37
|
type: "string",
|
|
38
38
|
label: "Use Google Ads As",
|
|
39
|
-
description: "
|
|
39
|
+
description: "The ID of an account of a [customer directly accessible by the authenticated user](https://developers.google.com/google-ads/api/reference/rpc/v21/CustomerService/ListAccessibleCustomers?transport=rest). This is usually a Manager Account, used as `login-customer-id` (e.g., `1234567890`). Use the **List Account ID Options** action to get the list of accessible accounts.",
|
|
40
40
|
async options() {
|
|
41
41
|
const response = await this.listAccessibleCustomers();
|
|
42
42
|
return response?.map(((resourceName) => ({
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
customerClientId: {
|
|
49
49
|
type: "string",
|
|
50
50
|
label: "Managed Account",
|
|
51
|
-
description: "
|
|
51
|
+
description: "The ID of a [customer client](https://developers.google.com/google-ads/api/reference/rpc/v21/CustomerClient) from the list of [customers linked to the selected account](https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy) (e.g., `1234567890`). Use the **List Customer Clients** action to get the list of customer clients.",
|
|
52
52
|
useQuery: true,
|
|
53
53
|
optional: true,
|
|
54
54
|
async options({
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_ads-new-campaign-created",
|
|
8
8
|
name: "New Campaign Created",
|
|
9
9
|
description: "Emit new event when a new campaign is created. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.8",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
sampleEmit,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "google_ads-new-lead-form-entry",
|
|
9
9
|
name: "New Lead Form Entry",
|
|
10
10
|
description: "Emit new event for new leads on a Lead Form. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.8",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
14
14
|
sampleEmit,
|