Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
md 110 lines 9.11 KB
Rendered Raw
1 ## How do I set up custom Google OAuth credentials for Google Ads?
2
3 Use your own Google OAuth app when you want your app name on the consent screen, your own API quota, or full control over the requested scopes.
4
5 You need a Google Ads account you can access and its 10-digit Customer ID. Live-account API access is controlled by the Google Cloud project that owns the OAuth client, not by a developer token on the auth config.
6
7 ### Create the Google OAuth app
8
9 1. In [Google Cloud Console](https://console.cloud.google.com/), select the project that will own the OAuth client, or create one.
10
11 ![Google Cloud console project picker](/images/toolkits/shared/hjaj4jg5CtBRolXXYddY8NDXCes.webp)
12
13 2. Open **APIs & Services** → **Library**, search for **Google Ads API**, and select **Enable**. If the page shows **Manage**, the API is already enabled.
14
15 ![Google Ads API page in the API Library with the Enable button](/images/toolkits/googleads/enable-google-ads-api.webp)
16
17 3. Enabling the Google Ads API grants **Test** access only. To use production Ads accounts, open the Google Ads API **Overview** page for your Cloud project and apply for **Explorer** access. Higher usage or extra features can require **Basic** or **Standard** access. See Google's [access levels](https://developers.google.com/google-ads/api/docs/api-policy/access-levels) and [Cloud project setup](https://developers.google.com/google-ads/api/docs/oauth/cloud-project).
18 4. Open **Google Auth Platform** → **Branding**. If Google shows **Get started**, enter the app name, user support email, and developer contact email, then save.
19
20 ![Google Auth Platform Branding page with app name, support email, and developer contact fields](/images/toolkits/shared/x4VkWS3iceKKFGyjlFN1THrtTRQ.webp)
21
22 5. Open **Audience**. Choose **Internal** to limit the app to users in your Google Workspace organization, or **External** for consumer accounts and users outside it. While an external app's publishing status is **Testing**, only accounts listed under **Test users** can connect, so add every account you'll test with.
23
24 ![Google Auth Platform Audience page with Testing status, External user type, and Test users](/images/toolkits/shared/Jttbz3Cm6xJFWNlukXLGTxWjf6c.webp)
25
26 6. Open **Data Access** → **Add or remove scopes** and add the scopes listed under **Scopes** below. If a scope isn't in the list, paste its full URL under **Manually add scopes** and select **Add to table**. Select **Update**, then **Save**.
27
28 ![Data Access scope picker with the Google Ads adwords scope selected](/images/toolkits/googleads/data-access-adwords-scope.webp)
29
30 7. Open **Clients** → **Create client**, choose **Web application**, and give it a name.
31
32 ![Create OAuth client ID form with Web application selected and a client name](/images/toolkits/shared/sA0bvCBPtMCWw8lqecCrx76Dyc.webp)
33
34 8. Under **Authorized redirect URIs**, add `https://backend.composio.dev/api/v1/auth-apps/add`. It must exactly match the `oauth_redirect_uri` field on your Composio auth config.
35
36 ![OAuth client form with the Composio redirect URI under Authorized redirect URIs](/images/toolkits/shared/jDTS80dlfwHF6u1WAQhBdnjTrI.webp)
37
38 9. Select **Create**. Copy the **Client ID** and **Client secret**. Google shows the full secret only once, so save it before you close the dialog.
39
40 ![OAuth client created dialog with the Client ID and Client secret](/images/toolkits/shared/YdKWAswsL2nVXnSbA4zgBUDmwA.webp)
41
42 ### Create the auth config in Composio
43
44 1. In the [Composio dashboard](https://dashboard.composio.dev/~/project/auth-configs?utm_source=docs&utm_medium=content&utm_campaign=toolkits-googleads), open **Auth Configs** → **Create** and select **Google Ads**.
45
46 ![Composio Auth Configs page with the Create button](/images/toolkits/shared/DUtMN0UWIU2kEqnvS5DvD7qhWU.webp)
47
48 ![Create Auth Config dialog with Google Ads in the search results](/images/toolkits/googleads/select-google-ads-toolkit.webp)
49
50 2. Choose **OAuth 2.0** and **Your Own Credentials**, then paste your **Client ID** and **Client secret**. Leave **Redirect URI** unchanged, keep the scopes in line with what you added in Google, and select **Create Auth Config**.
51
52 ![Google Ads auth config form with Client ID, Client secret, Redirect URI, an empty Developer Token field, and the adwords scope](/images/toolkits/googleads/auth-config-credentials.webp)
53
54 3. Open the auth config, select **Connect Account**, and enter the Customer ID of the Google Ads account or manager (MCC) account you want to use, for example `123-456-7890`. This is not your Google Cloud project ID. Then sign in with a Google account that can access that Ads account.
55
56 ![Composio Connect Account form asking for the Google Ads Customer ID](/images/toolkits/googleads/enter-customer-id.webp)
57
58 ![Google consent screen asking to manage your Google Ads accounts and data](/images/toolkits/googleads/google-consent-screen.webp)
59
60 4. Open **Accounts** on the auth config and confirm the connected account shows **Active**. The auth config's own **Enabled** label doesn't confirm a connection.
61
62 ![Composio auth config panel with the Google Ads connected account shown as Active](/images/toolkits/googleads/connected-account-active.webp)
63
64 For the general flow, see [Custom auth configs](/docs/auth-configuration/custom-auth-configs).
65
66 ### Scopes
67
68 The default auth config requests `https://www.googleapis.com/auth/adwords`. It's the only Google Ads API scope and includes account-management access, so it isn't read-only. The user's Google Ads account role still limits what they can do. See Google's [OAuth overview for Google Ads](https://developers.google.com/google-ads/api/docs/oauth/overview).
69
70 Short scope names on this page leave out the `https://www.googleapis.com/auth/` prefix. When you paste a scope under **Manually add scopes**, use the full URL, for example `https://www.googleapis.com/auth/userinfo.email`. Scopes already written as a full URL, such as `https://mail.google.com/`, go in as shown.
71
72 ### Developer token
73
74 If the auth config form shows a **Developer Token** field, you can leave it empty. It's a legacy field kept for older auth configs, and Composio no longer sends it to Google. API access comes from the Google Cloud project that owns your OAuth client.
75
76 ### Publish and verify the app
77
78 While an external app is in **Testing**, Google shows an unverified-app notice and refresh tokens expire after seven days, so users have to reconnect. Before you invite production users, select **Publish app** on the **Audience** page. A public app that requests sensitive or restricted scopes also needs Google's OAuth verification, which you start from **Verification Center**. Publishing doesn't complete verification on its own. Internal apps and apps in Testing can be exempt. See Google's [verification requirements](https://developers.google.com/identity/protocols/oauth2/production-readiness/overview).
79
80 ![Google hasn't verified this app notice for an app in Testing](/images/toolkits/shared/M0mS4XrLbK5mU52ry578MBa7M.webp)
81
82 If you change the requested scopes later, reconnect the account so the user grants the new access.
83
84 ## What can cause Google Ads 429s?
85
86 A Google Ads 429 / `RESOURCE_EXHAUSTED` is an upstream Google Ads API limit, not a Composio billing-plan or tool-call quota. Google Ads enforces limits on the underlying developer token, account, request pattern, service, and resource usage.
87
88 This can happen with Composio-managed credentials or with custom Google Ads credentials. Reduce request volume, add backoff, simplify expensive queries, and use an owned Google Ads OAuth app/developer token for production isolation where possible.
89
90 ## Google Ads MCC/sub-account targeting
91
92 For Google Ads manager-account (MCC) setups, `GOOGLEADS_LIST_ACCESSIBLE_CUSTOMERS` can succeed while GAQL/reporting or campaign calls against a child account fail. Two common Google errors are:
93
94 - 403 `USER_PERMISSION_DENIED` with guidance that, when accessing a client customer, the manager customer ID must be set in the `login-customer-id` header.
95 - `REQUESTED_METRICS_FOR_MANAGER` when metric fields are queried directly from the MCC manager account instead of a child/customer account.
96
97 Treat this as MCC targeting/account-context, not OAuth. Reconnecting alone does not fix it unless the user had connected the wrong account context.
98
99 Correct call shape:
100
101 - target child/customer account ID in the request path, for example `/customers/{child_customer_id}/googleAds:searchStream`
102 - manager/MCC customer ID in the `login-customer-id` header
103
104 ## Google Ads OAuth callback token-exchange failures usually point to bad credentials
105
106 The `OAuth callback failed during token exchange` error usually means the credentials used to complete the auth flow are incorrect, most often the client secret. Re-enter or update the client secret in the Google Ads auth config, make sure there are no leading/trailing spaces, and initiate a new connection.
107
108 ## What do custom Google OAuth apps need for white-label consent?
109
110 For Google toolkits, creating a new authConfig with the user's OAuth app credentials is not enough for full white-label consent. They also need to route the callback through their own domain using their own redirect URI so Google displays the configured consent screen for that OAuth app.