OAuth Service Account Flow

This guide will walk you through how to setup OAuth2 for API access using your own credentials using service accounts. These steps only need to be done once, unless you revoke or delete your OAuth2 credentials.

Create OAuth2 credentials

Generate a service account ID and a *.JSON file by following the linked instructions, then come back to this page.

Set up client library

Set the private key JSON path in your configuration. If you're authenticating using impersonation, also set the user to impersonate.

If you're using an ads.properties file, add the following:

api.googleads.serviceAccountSecretsPath=PRIVATE_KEY_FILE_PATH
# Only add this key if you are using impersonation.
api.googleads.serviceAccountUser=USER_TO_IMPERSONATE

See the configuration guide for additional details.