Stay organized with collections
Save and categorize content based on your preferences.
This guide will walk you through how to set up OAuth2 for API access using your
own credentials with service accounts.
These steps only need to be done once, unless you revoke or delete your OAuth2
credentials.
Add a private key JSON and an impersonated email to configuration
Set the private key JSON file path and impersonated email in your configuration.
If you're using a google-ads.yaml file, YAML string, or dict, add the
following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[[["This guide explains how to set up OAuth2 for API access using service accounts, a one-time process unless credentials are revoked."],["The setup requires a Google Workspace domain and a service account with domain-wide delegation access granted by a super administrator."],["You need to generate a service account ID and a JSON file, then add the private key JSON file path and impersonated email to your configuration."],["Configuration can be set using a `google-ads.yaml` file, YAML string, `dict`, or environment variables."],["The library prioritizes credentials for desktop or web app flows, so ensure these are not present if you want to use Service Account authentication."]]],[]]