Skip to content

Commit a19722b

Browse files
Google ads readme update (#14941)
* Adding instructions on how to write custom requests with proxy. * lockfile * typo
1 parent 877596e commit a19722b

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

components/google_ads/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,44 @@ and campaigns programmatically. With the API, you can automate common tasks,
1818
such as creating and managing campaigns, adding and removing keywords, and
1919
adjusting bids. You can also use the API to get information about your
2020
campaigns, such as campaign stats, keyword stats, and ad performance.
21+
22+
## Customizing API requests with the Pipedream proxy
23+
24+
The Pipedream components interact with Google Ads API through Pipedream's proxy service, which handles authentication and developer token requirements.
25+
26+
The component accepts a standard Google Ads API request object with the following structure:
27+
28+
```javascript
29+
const googleAdsReq = {
30+
method: "get|post|put|delete", // HTTP method
31+
url: "/v16/...", // Google Ads API endpoint path
32+
headers: {
33+
"Authorization": `Bearer ${this.googleAds.$auth.oauth_access_token}`
34+
},
35+
data: {} // Optional request body for POST/PUT requests
36+
}
37+
```
38+
39+
To make different API calls while using the proxy:
40+
41+
1. Modify the `url` path to match your desired Google Ads API endpoint
42+
2. Update the `method` to match the required HTTP method
43+
3. Add any necessary request body data in the `data` field
44+
4. Include any required headers (Authorization is automatically included)
45+
46+
Example for a custom query:
47+
48+
```javascript
49+
const googleAdsReq = {
50+
method: "post",
51+
url: "/v16/customers/1234567890/googleAds:search",
52+
headers: {
53+
"Authorization": `Bearer ${this.googleAds.$auth.oauth_access_token}`
54+
},
55+
data: {
56+
query: "SELECT campaign.id, campaign.name FROM campaign"
57+
}
58+
}
59+
```
60+
61+
The proxy endpoint will remain the same: `https://eolid4dq1k0t9hi.m.pipedream.net`

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)