Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions ads.properties.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# - All settings in this file can be set & overridden programmatically.
# e.g. GoogleAdsClient.newBuilder()
# .fromPropertiesFile() // optionally load from config file.
# .setDeveloperToken("your_token")
# .setLoginCustomerId(1234567890L)

# ------------------------------- OAuth 2.0 ---------------------------------------
#
Expand Down Expand Up @@ -65,18 +65,6 @@

# -------------------------- Google Ads API -----------------------------------

# Developer token
#
# Specifies the credential used to access the Google Ads API.
#
# - Grants access to the API, not any Google account or Google Ads account.
# - Associated with a Google Ads manager accoount.
# - Found by logging into the manager account on http://ads.google.com
# and navigating to -> Tools & Settings -> API Center.
# - An unapproved developer token can be used to issue requests against test
# accounts.
#api.googleads.developerToken=

# Login customer ID
#
# Specifies an ad account which grants access to ad accounts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,13 @@ public void runExample(
adsProperties.put(ConfigPropertyKey.CLIENT_SECRET.getPropertyKey(), clientSecret);
adsProperties.put(
ConfigPropertyKey.REFRESH_TOKEN.getPropertyKey(), userCredentials.getRefreshToken());
adsProperties.put(
ConfigPropertyKey.DEVELOPER_TOKEN.getPropertyKey(), "INSERT_DEVELOPER_TOKEN_HERE");

showConfigurationFile(adsProperties);
}

private void showConfigurationFile(Properties adsProperties) throws IOException {
System.out.printf(
"Copy the text below into a file named %s in your home directory, and replace "
+ "INSERT_XXX_HERE with your configuration:%n",
"Copy the text below into a file named %s in your home directory:%n",
GoogleAdsClient.Builder.DEFAULT_PROPERTIES_CONFIG_FILE_NAME);
System.out.println(
"######################## Configuration file start ########################");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
public class ConfigureClientLibraryProgrammatically {

private static final String DEVELOPER_TOKEN = "INSERT_DEVELOPER_TOKEN";
private static final String OAUTH_CLIENT_ID = "INSERT_CLIENT_ID";
private static final String OAUTH_CLIENT_SECRET = "INSERT_CLIENT_SECRET";
private static final String REFRESH_TOKEN = "INSERT_REFRESH_TOKEN";
Expand All @@ -45,8 +44,6 @@ public static void main(String[] args) {
// Creates a GoogleAdsClient with the provided credentials.
GoogleAdsClient client =
GoogleAdsClient.newBuilder()
// Sets the developer token which enables API access.
.setDeveloperToken(DEVELOPER_TOKEN)
// Sets the OAuth credentials which provide Google Ads account access.
.setCredentials(credentials)
// Optional: sets the login customer ID. This is required when the Google account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ private void runExample(GoogleAdsClient googleAdsClient, List<Long> customerIds)
try (GoogleAdsServiceClient serviceClient =
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
// IMPORTANT: You should avoid hitting the same customer ID in parallel. There are rate limits
// at the customer ID level which are much stricter than limits at the developer token level.
// at the customer ID level which are much stricter than limits at the Google Cloud project
// level.
// Hitting these limits frequently enough will significantly reduce throughput as the client
// library will automatically retry with exponential back-off before failing the request.
for (String gaqlQuery : GAQL_QUERY_STRINGS) {
Expand Down
Loading