Hello, You may use this Java code snippet as reference:
public class ConversionValueRule { public static void main(String[] args) { AddConversionValueRuleParams params = new AddConversionValueRuleParams(); if (!params.parseArguments(args)) { // Either pass the required parameters for this example on the command line, or insert them // into the code here. See the parameter class definition above for descriptions. params.customerId = Long.parseLong("4985776047"); } GoogleAdsClient googleAdsClient = null; try { googleAdsClient = GoogleAdsClient.newBuilder().fromPropertiesFile().build(); } catch (FileNotFoundException fnfe) { System.err.printf( "Failed to load GoogleAdsClient configuration from file. Exception: %s%n", fnfe); System.exit(1); } catch (IOException ioe) { System.err.printf("Failed to create GoogleAdsClient. Exception: %s%n", ioe); System.exit(1); } try { new ConversionValueRule().runExample1(googleAdsClient, params.customerId); } catch (GoogleAdsException gae) { // GoogleAdsException is the base class for most exceptions thrown by an API request. // Instances of this exception have a message and a GoogleAdsFailure that contains a // collection of GoogleAdsErrors that indicate the underlying causes of the // GoogleAdsException. System.err.printf( "Request ID %s failed due to GoogleAdsException. Underlying errors:%n", gae.getRequestId()); int i = 0; for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) { System.err.printf(" Error %d: %s%n", i++, googleAdsError); } System.exit(1); } } private void runExample1(GoogleAdsClient googleAdsClient, long customerId) { List<String> geoTargetCountryCodes = ImmutableList.of("US"); // Create a geo location condition. com.google.ads.googleads.v14.resources.ConversionValueRule.ValueRuleGeoLocationCondition geoLocationCondition = com.google.ads.googleads.v14.resources.ConversionValueRule.ValueRuleGeoLocationCondition.newBuilder() .addGeoTargetConstants("geoTargetConstants/1014044") .setGeoMatchType(ValueRuleGeoLocationMatchTypeEnum.ValueRuleGeoLocationMatchType.ANY) .build(); com.google.ads.googleads.v14.resources.ConversionValueRule conversionValueRule = com.google.ads.googleads.v14.resources.ConversionValueRule.newBuilder() .setAction(com.google.ads.googleads.v14.resources.ConversionValueRule.ValueRuleAction.newBuilder().setOperation(ValueRuleOperationEnum.ValueRuleOperation.ADD).setValue(45).build()) .setGeoLocationCondition(geoLocationCondition) .build(); // Creates the operation. ConversionValueRuleOperation operation = ConversionValueRuleOperation.newBuilder() .setCreate(conversionValueRule).build(); try (ConversionValueRuleServiceClient conversionValueRuleServiceClient = googleAdsClient.getLatestVersion().createConversionValueRuleServiceClient()) { MutateConversionValueRulesRequest request = MutateConversionValueRulesRequest.newBuilder() .setCustomerId("XXXX") .addAllOperations(Collections.singletonList(operation)) .setPartialFailure(true) .setValidateOnly(false) .setResponseContentType(ResponseContentTypeEnum.ResponseContentType.MUTABLE_RESOURCE) .build(); MutateConversionValueRulesResponse response = conversionValueRuleServiceClient.mutateConversionValueRules(request); } } private static class AddConversionActionParams extends CodeSampleParams { @Parameter(names = ArgumentNames.CUSTOMER_ID, required = true) private Long customerId; } } I hope this helps. This message is in relation to case "ref:_00D1U1174p._5004Q2nrBho:ref" Thanks, Google Ads API Team -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/SFVrv000000000000000000000000000000000000000000000RZGDR0005omltQtYT-WARRxWjTwmkA%40sfdc.net.