Configure a Google API Console Project for the Google Ads API

Credentials for accessing Google's OAuth2 servers are required in order to authenticate and authorize Google Ads users. These credentials identify your app to Google, and allow you to generate OAuth tokens for managing Google Ads users. Access to Google OAuth2 credentials is managed from the Google API Console.

Watch this video for some Cloud project best practices

Create a project

Go to the Google API Console. Click Create project, enter a name, and click Create.

Enable the Google Ads API in your project

To enable the Google Ads API for your project, do the following:

  1. 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.

  2. Use search to find the Google Ads API if it isn't visible in the list.

  3. Select the Google Ads API, then click the Enable button.

Choose an app type

There are two app type options for the Google Ads API:

  • Desktop apps
  • Web apps

Check the table below to determine which type is most appropriate for the app you want to build:

Choose this app type If ...
Desktop app
  • You're managing all of your Google Ads accounts using a single top level manager account.
  • You're a first-time user, or want to get started quickly with the simplest setup.
  • Your app will only authenticate Google users from one machine.
Web app
  • You want to authenticate as a user who can grant permission to your app to access their Google Ads account data.
  • You want to easily generate multiple authorization credentials, to manage third-party accounts for example.
  • Your app requires callback URLs. Callback URLs are not supported in the desktop app flow.

For more details, refer to the Google Identity Platform OAuth documentation for desktop apps or web apps.

Create a client ID and client secret

Once you've determined your app type, follow the instructions below to generate the OAuth2 client ID and client secret:

  1. Open the Credentials page. Select a previously created project or create a new one.

  2. On the Credentials screen, click CREATE CREDENTIALS, then select OAuth client ID.

    1. If you hadn't configured an OAuth consent screen for this project previously, you'll be directed to do so now. Click CONFIGURE CONSENT SCREEN.

      1. Select the user type and click CREATE.

      2. Fill out the initial form. You can edit this later if needed. Click Save when done.

    2. Navigate back to Credentials > CREATE CREDENTIALS > OAuth client ID to continue.

  3. Select either Desktop app or Web application as the app type, depending on your use case.

  4. Give it a name, then click Create.

  5. If your client type is Web application, add at least one authorized redirect URI.

    For local testing that's compatible with the default configuration in our client library examples, use http://127.0.0.1.

    For Desktop app clients, you will still use a loopback IP redirect, but the URI is not explicitly configured in the Cloud console.

  6. On the confirmation page, copy Your Client ID and Your Client Secret to your clipboard, as you will need them when you configure your client library. You can also return to the credentials page later to retrieve these details.