Skip to content

Commit 104ea14

Browse files
PierrickVouletpierrick
andauthored
Add missing region tags (#422)
Change-Id: If7cefe520891b8dc1e20cfa8c3ef2159e6b79cf8 Co-authored-by: pierrick <pierrick@google.com>
1 parent 2981629 commit 104ea14

6 files changed

Lines changed: 36 additions & 2 deletions

File tree

google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/GetChangeDetails.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public static void main(String[] args) {
8888
}
8989

9090
/** Runs the example. */
91+
// [START get_change_details]
9192
private void runExample(GoogleAdsClient googleAdsClient, long customerId) {
9293
// Defines a GAQL query to retrieve change_event instances from the last 14 days.
9394
String query =
@@ -166,6 +167,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) {
166167
}
167168
}
168169
}
170+
// [END get_change_details]
169171

170172
/** Retrieves the resource from a {@link ChangeEvent.ChangedResource} instance. */
171173
private Optional<Message> getResourceByType(

google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddLocalCampaign.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) throws
143143
}
144144

145145
/** Creates a campaign budget. */
146+
// [START add_local_campaign]
146147
private String createCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) {
147148
// Creates a CampaignBudget object.
148149
CampaignBudget budget =
@@ -172,8 +173,10 @@ private String createCampaignBudget(GoogleAdsClient googleAdsClient, long custom
172173
return resourceName;
173174
}
174175
}
176+
// [END add_local_campaign]
175177

176178
/** Creates a local campaign. */
179+
// [START add_local_campaign_1]
177180
private String createLocalCampaign(
178181
GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName) {
179182
// Creates a Campaign object.
@@ -233,8 +236,10 @@ private String createLocalCampaign(
233236
return resourceName;
234237
}
235238
}
239+
// [END add_local_campaign_1]
236240

237241
/** Creates a local campaign ad-group. */
242+
// [START add_local_campaign_2]
238243
private String createAdGroup(
239244
GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) {
240245
// Creates an ad group. Note that the ad group type must not be set.
@@ -264,8 +269,10 @@ private String createAdGroup(
264269
return resourceName;
265270
}
266271
}
272+
// [END add_local_campaign_2]
267273

268274
/** Creates a local ad. */
275+
// [START add_local_campaign_3]
269276
private void createLocalAd(
270277
GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName)
271278
throws IOException {
@@ -322,6 +329,7 @@ private void createLocalAd(
322329
System.out.printf("Created ad group ad with resource name: '%s'.%n", resourceName);
323330
}
324331
}
332+
// [END add_local_campaign_3]
325333

326334
// --------------------------------- Utility functions -------------------------------------------
327335

@@ -331,6 +339,7 @@ private AdTextAsset createTextAsset(String s) {
331339
}
332340

333341
/** Creates an {@link AdImageAsset}. */
342+
// [START add_local_campaign_4]
334343
private static AdImageAsset createImageAsset(
335344
GoogleAdsClient googleAdsClient, long customerId, String imageUrl, String imageName)
336345
throws IOException {
@@ -359,8 +368,10 @@ private static AdImageAsset createImageAsset(
359368
return AdImageAsset.newBuilder().setAsset(imageResourceName).build();
360369
}
361370
}
371+
// [END add_local_campaign_4]
362372

363373
/** Creates a {@link AdVideoAsset}. */
374+
// [START add_local_campaign_5]
364375
private AdVideoAsset createYoutubeVideoAsset(
365376
GoogleAdsClient googleAdsClient, long customerId, String youtubeVideoId, String videoName) {
366377
// Creates an Asset object.
@@ -390,4 +401,5 @@ private AdVideoAsset createYoutubeVideoAsset(
390401
return AdVideoAsset.newBuilder().setAsset(resourceName).build();
391402
}
392403
}
404+
// [END add_local_campaign_5]
393405
}

google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddAffiliateLocationExtensions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ private void runExample(
137137
}
138138

139139
/** Creates an affiliate location extension feed. */
140+
// [START add_affiliate_location_extensions]
140141
private String createAffiliateLocationExtensionFeed(
141142
GoogleAdsClient googleAdsClient, long customerId, long chainId) {
142143
// Removes all existing location extension feeds. This is an optional step, but is required for
@@ -179,6 +180,7 @@ private String createAffiliateLocationExtensionFeed(
179180
return resourceName;
180181
}
181182
}
183+
// [END add_affiliate_location_extensions]
182184

183185
/** Removes all location extension feeds. */
184186
private void removeLocationExtensionFeeds(GoogleAdsClient googleAdsClient, long customerId) {
@@ -200,6 +202,7 @@ private void removeLocationExtensionFeeds(GoogleAdsClient googleAdsClient, long
200202
}
201203

202204
/** Creates a CampaignFeed. This links a preexisting {@link Feed} to a campaign. */
205+
// [START add_affiliate_location_extensions_3]
203206
private void createCampaignFeed(
204207
GoogleAdsClient googleAdsClient,
205208
long customerId,
@@ -244,8 +247,10 @@ private void createCampaignFeed(
244247
response.getResultsList().get(0).getResourceName());
245248
}
246249
}
250+
// [END add_affiliate_location_extensions_3]
247251

248252
/** Gets the feed item attribute ID that specifies the chain ID. */
253+
// [START add_affiliate_location_extensions_4]
249254
private long getAttributeIdForChainId(FeedMapping feedMapping) {
250255
Optional<AttributeFieldMapping> fieldMapping =
251256
feedMapping.getAttributeFieldMappingsList().stream()
@@ -257,6 +262,7 @@ private long getAttributeIdForChainId(FeedMapping feedMapping) {
257262
}
258263
return fieldMapping.get().getFeedAttributeId();
259264
}
265+
// [END add_affiliate_location_extensions_4]
260266

261267
/** Removes a list of feeds from the customerID. */
262268
private void removeFeeds(GoogleAdsClient googleAdsClient, long customerId, List<Feed> feeds) {
@@ -334,6 +340,7 @@ private List<CustomerFeed> getLocationExtensionCustomerFeeds(
334340
}
335341

336342
/** Waits for a feed (identified by it's feedResourceName) to become ready. */
343+
// [START add_affiliate_location_extensions_2]
337344
private FeedMapping waitForFeedToBeReady(
338345
GoogleAdsClient googleAdsServiceClient, long customerId, String feedResourceName) {
339346
int numAttempts = 0;
@@ -370,8 +377,10 @@ private FeedMapping waitForFeedToBeReady(
370377
GrpcStatusCode.of(Code.DEADLINE_EXCEEDED),
371378
true);
372379
}
380+
// [END add_affiliate_location_extensions_2]
373381

374382
/** Retrieves the {@link FeedMapping} for a given feed. */
383+
// [START add_affiliate_location_extensions_1]
375384
private Optional<FeedMapping> getFeedMapping(
376385
GoogleAdsClient googleAdsServiceClient, long customerId, String feedResourceName) {
377386
String query =
@@ -397,4 +406,5 @@ private Optional<FeedMapping> getFeedMapping(
397406
return Optional.empty();
398407
}
399408
}
409+
// [END add_affiliate_location_extensions_1]
400410
}

google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelAdGroupBidModifiers.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public static void main(String[] args) {
101101
* @param adGroupId the ID of the ad group.
102102
* @throws GoogleAdsException if an API request failed with one or more service errors.
103103
*/
104+
// [START add_hotel_ad_group_bid_modifiers]
104105
private void runExample(GoogleAdsClient googleAdsClient, long customerId, long adGroupId) {
105106
List<AdGroupBidModifierOperation> operations = new ArrayList<>();
106107

@@ -149,4 +150,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a
149150
}
150151
}
151152
}
153+
// [END add_hotel_ad_group_bid_modifiers]
152154
}

google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelListingGroupTree.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private static String addRootNode(
213213
* @return the "other hotel classes" node's resource name, which serves as a parent node for the
214214
* next level.
215215
*/
216-
// [START add_level1_nodes]
216+
// [START add_hotel_listing_group_tree]
217217
private static String addLevel1Nodes(
218218
long customerId,
219219
long adGroupId,
@@ -264,7 +264,7 @@ private static String addLevel1Nodes(
264264

265265
return otherHotelsAdGroupCriterion.getResourceName();
266266
}
267-
// [END add_level1_nodes]
267+
// [END add_hotel_listing_group_tree]
268268

269269
/**
270270
* Creates child nodes of level 2, partitioned by the country region.

google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/ForecastReach.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ private void showPlannableLocations(ReachPlanServiceClient reachPlanServiceClien
148148
* https://developers.google.com/google-ads/api/reference/data/geotargets or call
149149
* ReachPlanServiceClient.listPlannableLocations().
150150
*/
151+
// [START forecast_reach_2]
151152
private void showPlannableProducts(
152153
ReachPlanServiceClient reachPlanServiceClient, String locationId) {
153154
ListPlannableProductsRequest request =
@@ -172,6 +173,7 @@ private void showPlannableProducts(
172173
}
173174
}
174175
}
176+
// [END forecast_reach_2]
175177

176178
/**
177179
* Creates a base request to generate a reach forecast.
@@ -225,6 +227,7 @@ private GenerateReachForecastRequest buildReachRequest(
225227
* @param reachPlanServiceClient instance of Reach Plan Service client.
226228
* @param request an already-populated reach curve request.
227229
*/
230+
// [START forecast_reach]
228231
private void getReachCurve(
229232
ReachPlanServiceClient reachPlanServiceClient, GenerateReachForecastRequest request) {
230233
GenerateReachForecastResponse response = reachPlanServiceClient.generateReachForecast(request);
@@ -250,6 +253,7 @@ private void getReachCurve(
250253
System.out.printf("\"%n");
251254
}
252255
}
256+
// [END forecast_reach]
253257

254258
/**
255259
* Pulls a forecast for a budget split 15% and 85% between two products.
@@ -262,6 +266,7 @@ private void getReachCurve(
262266
* @param currencyCode three-character ISO 4217 currency code.
263267
* @param budgetMicros budget in currency to plan for.
264268
*/
269+
// [START forecast_reach_3]
265270
private void forecastManualMix(
266271
ReachPlanServiceClient reachPlanServiceClient,
267272
long customerId,
@@ -293,6 +298,7 @@ private void forecastManualMix(
293298

294299
getReachCurve(reachPlanServiceClient, request);
295300
}
301+
// [END forecast_reach_3]
296302

297303
/**
298304
* Pulls a forecast for a product mix suggested based on preferences for whether the ad would have
@@ -307,6 +313,7 @@ private void forecastManualMix(
307313
* @param currencyCode three-character ISO 4217 currency code.
308314
* @param budgetMicros budget in currency to plan for.
309315
*/
316+
// [START forecast_reach_1]
310317
private void forecastSuggestedMix(
311318
ReachPlanServiceClient reachPlanServiceClient,
312319
long customerId,
@@ -349,4 +356,5 @@ private void forecastSuggestedMix(
349356

350357
getReachCurve(reachPlanServiceClient, curveRequest);
351358
}
359+
// [END forecast_reach_1]
352360
}

0 commit comments

Comments
 (0)