Using OAuth 2.0 to Access Google Ads API

  • All Google Ads API calls require authorization through OAuth2, safeguarding user login information.

  • Authorizing requests involves configuring a Cloud project and a client library for OAuth in the Google Ads API.

  • Developers can utilize service accounts, delve into OAuth2 internals, and employ the OAuth Playground for advanced functionalities.

Just like other Google APIs, Google Ads API also uses the OAuth 2.0 protocol for authentication and authorization. OAuth 2.0 enables your Google Ads API client app to access a user's Google Ads account without having to handle or store the user's login info.

Broadly speaking, all the OAuth 2.0 authorization scenarios that Google supports also works with Google Ads API. However, we will focus on a handful of scenarios that are most common for Google Ads API developers.

Scenario Recommended approach
My app already uses one or more Google APIs. I have already built support for OAuth 2.0 workflows for my app, and just need to add Google Ads API functionality to my existing app.
  1. Make sure your authorized user or your service account has access to the Google Ads API accounts you are making API calls to. Learn more about the Google Ads access model.
  2. Refer to the multi-user authentication workflow or the service account workflow depending on the approach you are using with the rest of the Google APIs that your app is using.
I am building an app that manages Google Ads accounts that I already have access to. If I need to manage new Google Ads accounts in the future, I will gain access to those accounts by linking them under my Google Ads Manager account.

OR

Someone will invite me to manage those accounts.

Use service account workflow.

If you have organizational policies that prevent you from using service accounts, then use single-user authentication workflow as a fallback.

I am building an app that manages Google Ads accounts on behalf of other users. My app will build a user screen that lets the logged in users to connect to their Google Ads accounts and authorize my app to manage those accounts on their behalf. Use multi-user authentication.