Skip to content

Commit 662d60b

Browse files
authored
Fix handling of scenario with no provided geoTargetConstantId (#324)
1 parent daecc8a commit 662d60b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ private static class AddGeoTargetParams extends CodeSampleParams {
4545
@Parameter(names = ArgumentNames.FEED_ITEM_ID, required = true)
4646
private Long feedItemId;
4747

48-
@Parameter(names = ArgumentNames.GEO_TARGET_CONSTANT_ID)
49-
private Long geoTargetConstantId;
48+
@Parameter(
49+
names = ArgumentNames.GEO_TARGET_CONSTANT_ID,
50+
description =
51+
"The geo target constant ID to add to the extension feed item. A default value will be"
52+
+ " used if no value is provided.")
53+
private Long geoTargetConstantId = GEO_TARGET_CONSTANT_ID;
5054
}
5155

5256
public static void main(String[] args) {
@@ -103,7 +107,7 @@ public static void main(String[] args) {
103107
* @param geoTargetConstantId the geo target constant ID to add to the extension feed item.
104108
*/
105109
private void runExample(
106-
GoogleAdsClient googleAdsClient, long customerId, long feedItemId, long geoTargetConstantId) {
110+
GoogleAdsClient googleAdsClient, long customerId, long feedItemId, Long geoTargetConstantId) {
107111
// Creates an extension feed item using the specified feed item ID and geo target constant
108112
// ID for targeting.
109113
ExtensionFeedItem extensionFeedItem =

0 commit comments

Comments
 (0)