OAuth Service Account Flow

This guide will walk you through how to set up 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 with JSON file

Configure the following keys in your google_ads_php.ini. See the configuration guide for additional details.

; For service account flow.
jsonKeyFilePath = "path/to/your/oauth2/key/file.json"
scopes = "https://www.googleapis.com/auth/adwords"
impersonatedEmail = "impersonated.account@email.com"