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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private void runExample(GoogleAdsClient googleAdsClient, Long managerId) {
// Optional: Sets additional attributes of the customer.
.setTrackingUrlTemplate("{lpurl}?device={device}")
.setFinalUrlSuffix("keyword={keyword}&matchtype={matchtype}&adgroupid={adgroupid}")
.setHasPartnersBadge(false)
.build();

// Sends the request to create the customer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
import java.util.List;
import java.util.Map;

/** Adds a page feed with URLs for a Dynamic Search Ads Campaign. */
/**
* Adds a page feed with URLs for a Dynamic Search Ads Campaign.
*/
public class AddDynamicPageFeed {

private static final int PAGE_SIZE = 1_000;
Expand Down Expand Up @@ -412,11 +414,10 @@ private static void updateCampaignDsaSetting(
private static DynamicSearchAdsSetting getDsaSetting(
GoogleAdsClient googleAdsClient, long customerId, long campaignId) {
// Creates the query.
// You must request all DSA fields in order to update the DSA settings in the following step.
String query =
String.format(
"SELECT campaign.id, campaign.name, campaign.dynamic_search_ads_setting.domain_name,"
+ " campaign.dynamic_search_ads_setting.language_code,"
"SELECT campaign.id, "
+ " campaign.name, "
+ " campaign.dynamic_search_ads_setting.use_supplied_urls_only "
+ "FROM campaign "
+ "WHERE campaign.id = '%s'",
Expand Down Expand Up @@ -446,8 +447,7 @@ private static DynamicSearchAdsSetting getDsaSetting(
.getResults(0)
.getCampaign()
.hasDynamicSearchAdsSetting()) {
throw new IllegalArgumentException(
String.format("Campaign with ID '%s' is not a " + "DSA campaign.", campaignId));
throw new IllegalArgumentException("Campaign with ID '%s' is not a DSA campaign.");
}

// Retrieves and returns the DSA setting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static class AddAffiliateLocationExtensionsParams extends CodeSamplePara
names = ArgumentNames.CHAIN_ID,
description =
"The retail chain ID. See"
+ " https://developers.google.com/adwords/api/docs/appendix/codes-formats#chain-idsfor"
+ " https://developers.google.com/google-ads/api/reference/data/codes-formats#chain-ids"
+ " a complete list of valid retail chain IDs",
required = true)
private long chainId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class AddGeoTarget {

// A list of country codes can be referenced here:
// https://developers.google.com/adwords/api/docs/appendix/geotargeting
// https://developers.google.com/google-ads/api/reference/data/geotargets
private static long GEO_TARGET_CONSTANT_ID = 2840L; // US

private static class AddGeoTargetParams extends CodeSampleParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private static List<String> createExtensionFeedItems(

// Targets this sitelink for United States only.
// A list of country codes can be referenced here:
// https://developers.google.com/adwords/api/docs/appendix/geotargeting
// https://developers.google.com/google-ads/api/reference/data/geotargets
String unitedStates = ResourceNames.geoTargetConstant(2840);

ExtensionFeedItem extensionFeedItem2 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private static void addLevel2Nodes(
List<AdGroupCriterionOperation> operations,
long percentCpcBidMicroAmount) {
// The criterion ID for Japan is 2392.
// See https://developers.google.com/adwords/api/docs/appendix/geotargeting for criteria ID
// See https://developers.google.com/google-ads/api/reference/data/geotargets for criteria IDs
// of other countries.
long japanGeoTargetConstantId = 2392;
ListingDimensionInfo japanDimensionInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ private static String createKeywordPlanCampaign(
.setKeywordPlanNetwork(KeywordPlanNetwork.GOOGLE_SEARCH)
.setKeywordPlan(keywordPlanResource);

// See https://developers.google.com/adwords/api/docs/appendix/geotargeting
// See https://developers.google.com/google-ads/api/reference/data/geotargets
// for the list of geo target IDs.
campaign.addGeoTargets(
KeywordPlanGeoTarget.newBuilder()
// Geo-target constant 2840 is for USA.
.setGeoTargetConstant(ResourceNames.geoTargetConstant(2840))
.build());

// See https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages
// See https://developers.google.com/google-ads/api/reference/data/codes-formats#languages
// for the list of language criteria IDs.
//
// Language criteria 1000 is for English.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void getReachCurve(
* @param reachPlanServiceClient instance of Reach Plan Service client.
* @param customerId the customer ID for the reach forecast.
* @param locationId location ID to plan for. To find a valid location ID, either see
* https://developers.google.com/adwords/api/docs/appendix/geotargeting or call
* https://developers.google.com/google-ads/api/reference/data/geotargets or call
* ReachPlanServiceClient.listPlannableLocations().
* @param currencyCode three-character ISO 4217 currency code.
* @param budgetMicros budget in currency to plan for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static class GenerateKeywordIdeasParams extends CodeSampleParams {
description =
"Location criteria IDs. For example, specify 21167 for New York. For more information"
+ " on determining this value, see: "
+ " https://developers.google.com/adwords/api/docs/appendix/geotargeting.")
+ " https://developers.google.com/google-ads/api/reference/data/geotargets.")
private List<Long> locationIds;

@Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static class AddCampaignTargetingCriteriaParams extends CodeSampleParams
description =
"A location criterion ID. For example, specify 21167 for New York. For more information"
+ " on determining this value, see: "
+ " https://developers.google.com/adwords/api/docs/appendix/geotargeting.")
+ " https://developers.google.com/google-ads/api/reference/data/geotargets.")
private Long locationId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void runExample(GoogleAdsClient googleAdsClient) {
requestBuilder.setLocale("en");

// A list of country codes can be referenced here:
// https://developers.google.com/adwords/api/docs/appendix/geotargeting
// https://developers.google.com/google-ads/api/reference/data/geotargets
requestBuilder.setCountryCode("FR");

requestBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static class SearchForLanguageAndCarrierConstantsParams extends CodeSamp
description =
"Country code for carrier constant filtering. A list of country codes can be"
+ " referenced here:"
+ " https://developers.google.com/adwords/api/docs/appendix/geotargeting.")
+ " https://developers.google.com/google-ads/api/reference/data/geotargets.")
private String countryCode = "US";
}

Expand Down