File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
actions/generate-keyword-ideas Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import common from "../common/common.mjs" ;
2+ import { getAdditionalFields } from "../common/props.mjs" ;
3+ import {
4+ parseObject , parseStringObject ,
5+ } from "../../common/utils.mjs" ;
6+ const docLink = "https://developers.google.com/google-ads/api/reference/rpc/v22/KeywordPlanIdeaService/GenerateKeywordIdeas?transport=rest" ;
7+
8+ export default {
9+ key : "google-ads-generate-keyword-ideas" ,
10+ name : "Generate Keyword Ideas" ,
11+ description : `Generate keyword ideas using the Google Ads API. [See the documentation](${ docLink } )` ,
12+ version : "0.0.1" ,
13+ type : "action" ,
14+ annotations : {
15+ destructiveHint : false ,
16+ openWorldHint : true ,
17+ readOnlyHint : true ,
18+ } ,
19+ props : {
20+ ...common . props ,
21+ additionalFields : getAdditionalFields ( docLink ) ,
22+ } ,
23+ async run ( { $ } ) {
24+ const additionalFields = parseObject ( parseStringObject ( this . additionalFields ) ) ;
25+ const response = await this . googleAds . generateKeywordIdeas ( {
26+ $,
27+ accountId : this . accountId ,
28+ customerClientId : this . customerClientId ,
29+ data : {
30+ ...additionalFields ,
31+ } ,
32+ } ) ;
33+ $ . export ( "$summary" , "Successfully generated keyword ideas." ) ;
34+ return response ;
35+ } ,
36+ } ;
Original file line number Diff line number Diff line change @@ -247,5 +247,12 @@ export default {
247247 ...args ,
248248 } ) ;
249249 } ,
250+ async generateKeywordIdeas ( opts = { } ) {
251+ return this . _makeRequest ( {
252+ method : "POST" ,
253+ path : "/v22/customers/{customerClientId}:generateKeywordIdeas" ,
254+ ...opts ,
255+ } ) ;
256+ } ,
250257 } ,
251258} ;
You can’t perform that action at this time.
0 commit comments