You need a Google API Console project for creating OAuth 2.0 credentials, configuring a user consent screen, and enabling the Google Ads API for your app.
The credentials are needed for the authentication and authorization of Google Ads users by Google servers. These credentials let you generate OAuth tokens to be used in calls to the API.
Although you can use a single developer token for multiple projects, each project can use only a single developer token.
Select or create a Google API Console project
If you already have a Google API Console project and want to use it to create credentials, you can skip to Create a client ID and client secret.
To create a project,
- Go to the Google API Console
- Click Create project
- Enter a name or accept the generated suggestion
- Confirm or edit any remaining fields
- Click Create
If you have billing enabled, select a billing account for the new project. There is no charge for using the Google Ads API, but there is a quota on the total number of Cloud projects.
Configure the OAuth consent screen
If you're using an existing Google API Console project and have configured an OAuth consent screen before, then you can skip this step and modify your consent screen instead by adding the Google Ads API OAuth 2.0 scope.
When you use OAuth 2.0 for authorization, Google displays a consent screen to the user including a summary of your project, its policies, and the requested authorization scopes of access. Configuring your app's OAuth consent screen defines what is displayed to users and app reviewers, and registers your app so you can publish it later.
Configure a new OAuth consent screen
- Open the Consent Screen page and select your project in the drop-down menu at the top of the page.
- Select the User Type and click CREATE.
- Fill out the consent screen form. You can edit this later if needed. Click SAVE AND CONTINUE when done.
- On the next page, click ADD OR REMOVE SCOPES.
- Scroll down and enter the following in the field under
Manually add scopes:
https://www.googleapis.com/auth/adwords
- Click ADD TO TABLE.
- Add any other scopes your project might need, then click UPDATE.
- Click SAVE AND CONTINUE.
- If you don't plan to publish your project immediately, add the email address of each user account you might use for testing, then click SAVE AND CONTINUE.
- Review the summary page and click BACK TO DASHBOARD.
Configure an existing OAuth consent screen
- Open the Consent Screen page, and select your project in the drop-down menu at the top of the page.
- Click EDIT APP.
- Click SAVE AND CONTINUE on the OAuth consent screen form.
- On the next page, click ADD OR REMOVE SCOPES.
- Scroll down and enter the following in the field under
Manually add scopes:
https://www.googleapis.com/auth/adwords
- Click ADD TO TABLE.
- Click SAVE AND CONTINUE.
- Click SAVE AND CONTINUE on the Test users form.
- Review the summary page and click BACK TO DASHBOARD.
Create a client ID and client secret
You can skip this step if you're using an existing Google API Console project that already has a generated client ID and secret.
After you've determined your app type, follow the instructions below to generate the OAuth 2.0 client ID and client secret:
Open the Credentials page. Select a previously created project or create a new one.
On the Credentials screen, click CREATE CREDENTIALS, then select OAuth client ID.
If you haven't configured an OAuth consent screen for this project previously, click CONFIGURE CONSENT SCREEN.
Select the user type and click CREATE.
Fill out the initial form. You can edit this later if needed. Click Save when done.
Navigate back to Credentials > CREATE CREDENTIALS > OAuth client ID to continue.
Select either Desktop app or Web application as the app type, depending on your use case. This guide uses Desktop app as the app type.
Fill in a name for the app, then click Create.
On the confirmation page, copy Your Client ID and Your Client Secret to your clipboard for configuring your client library later. Also, download the credentials in JSON format to a file named
credentials.json
.
Enable the Google Ads API in your project
To enable the Google Ads API in your project, follow these steps:
Open the API Library in the Google API Console. If prompted, select your project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.
Use search to find the Google Ads API if it isn't visible in the list.
Select the Google Ads API, then click the Enable button.