Trying to create Custom Conversion but I got this error.
errors {
error_code {
request_error: UNKNOWN
}
message: "The error code is not in this version."
location {
field_path_elements {
field_name: "operations"
index: 0
}
}
}
request_id: "31N9CDU3Y4IZMiAHAJE23w"
Here is my code:
public Map<String, Object> createCustomConversion(Long customerId, String conversionId) {
CustomConversionGoal customConversionGoal = CustomConversionGoal.newBuilder()
.setName("Custom Conversion Goal for campaign 1")
.setStatus(CustomConversionGoalStatusEnum.CustomConversionGoalStatus.ENABLED)
.addConversionActions(ResourceNames.conversionAction(customerId, Long.parseLong(conversionId)))
.build();
CustomConversionGoalOperation operation = CustomConversionGoalOperation.newBuilder()
.setCreate(customConversionGoal)
.build();
GoogleAdsClient client = sdkService.getGoogleAdsSDKClient(customerId);
try (CustomConversionGoalServiceClient serviceClient = client.getLatestVersion().createCustomConversionGoalServiceClient()) {
MutateCustomConversionGoalsRequest request = MutateCustomConversionGoalsRequest.newBuilder()
.setCustomerId(customerId.toString())
.addOperations(operation)
.setValidateOnly(false)
.build();
MutateCustomConversionGoalsResponse response = serviceClient.mutateCustomConversionGoals(request);
if (response.getResultsCount() == 0) {
return Utility.generateSuccessResponse();
}
return Utility.generateSuccessResponse();
} catch (GoogleAdsException e) {
BasicDBObject logParam = Utility.buildParam(customerId, customConversionGoal, false);
return Utility.generateErrorResponse(logParam, e);
} catch (Exception e) {
return Utility.generateErrorResponse(e);
}
}