Skip to content

Commit c7db44c

Browse files
authored
Fix 2 minor example issues for Dec. 2021 release. (#533)
* Update AddResponsiveSearchAdWithAdCustomizer.java * Update AddSmartCampaign.java * Update AddSmartCampaign.java
1 parent a39caf5 commit c7db44c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ private static class AddResponsiveSearchAdWithAdCustomizerParams extends CodeSam
6666
// Visit
6767
// https://developers.google.com/google-ads/api/docs/ads/customize-responsive-search-ads?hl=en#rules_and_limitations
6868
// for details.
69+
//
70+
// Specify the customizer attribute name here or the default specified below will be used.
6971
@Parameter(names = ArgumentNames.CUSTOMIZER_ATTRIBUTE_NAME)
70-
private String customizerAttributeName;
72+
private String customizerAttributeName = "Price";
7173
}
7274

7375
public static void main(String[] args) {
@@ -79,9 +81,9 @@ public static void main(String[] args) {
7981
// into the code here. See the parameter class definition above for descriptions.
8082
params.customerId = Long.parseLong("INSERT_CUSTOMER_ID_HERE");
8183
params.adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
82-
83-
// Optional: Specify a customizerAttributeName. The default value in this example is "Price".
84-
params.customizerAttributeName = "Price";
84+
// Optional: To use a different customizer attribute name from the default ("Price"),
85+
// uncomment the line below and insert the desired customizer attribute name.
86+
// params.customizerAttributeName = "INSERT_CUSTOMIZER_ATTRIBUTE_NAME_HERE";
8587
}
8688

8789
GoogleAdsClient googleAdsClient = null;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private void runExample(
194194
// [START add_smart_campaign_14]
195195
// Converts the location ID to unsigned long (potentially contains IDs with the most significant
196196
// bit set).
197-
long locationIdParsed = Long.parseUnsignedLong(locationId);
197+
Long locationIdParsed = (locationId == null ? null : Long.parseUnsignedLong(locationId));
198198
// [END add_smart_campaign_14]
199199

200200
// [START add_smart_campaign_12]

0 commit comments

Comments
 (0)