Hi! 
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);
}
}

On Tuesday, December 14, 2021 at 3:29:45 AM UTC+7 adsapi wrote:

> Hi Tài,
>
> To set as goal a specific conversion action when there are more than one 
> that has the same category and origin you would set up a custom 
> conversion goal 
> <https://developers.google.com/google-ads/api/docs/conversions/goals/campaign-goals?hl=en#custom_goals>.
>  
> This won't stop the need to set to false every other combination of 
> category and origin. Feel free to get back to us on what defaults make 
> sense. If you have full screenshots of how it's done in the UI that show 
> different ways to do this that are easier for you you can send them 
> privately to us.
>
> Regards,
>
> [image: Google Logo] 
> Aryeh Baker 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2SeaZx:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a3b80c5a-a08c-4e7a-a078-5e0725e65ac7n%40googlegroups.com.
  • Ca... Tài Ngô
    • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
      • ... Tài Ngô
        • ... Tài Ngô
          • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum

Reply via email to