set the bid adjustments on CRM user lists of a Ad Group

46 views
Skip to first unread message

Paid Media

unread,
Feb 16, 2022, 8:40:02 AM2/16/22
to Google Ads API and AdWords API Forum
I am using AdGroupCriterion to add multiple CRM user lists to Ad Group and set the bid adjustments on each CRM user list. using the following code snippet. 

String adGroup = ResourceNames.adGroup(customerId, adGroupId);
        String userList = ResourceNames.userList(customerId, userListId);
        AdGroupCriterion adGroupCriterion = AdGroupCriterion.newBuilder()
                .setStatus(AdGroupCriterionStatusEnum.AdGroupCriterionStatus.PAUSED)
                .setUserList(UserListInfo.newBuilder().setUserList(userList).build())
                .setAdGroup(adGroup)
                .setBidModifier(1)
                .build();
        AdGroupCriterionOperation operation = AdGroupCriterionOperation.newBuilder().setCreate(adGroupCriterion).build();

        try(AdGroupCriterionServiceClient serviceClient =
                    googleAdsClient.getLatestVersion().createAdGroupCriterionServiceClient()){
            MutateAdGroupCriteriaResponse response = serviceClient.mutateAdGroupCriteria(Long.toString(customerId), ImmutableList.of(operation));
            System.out.println("AdGroupCriterion is created " + response.getResults(0).getResourceName());


and getting following error 

Response
--------
Headers: Metadata(content-type=application/grpc,request-id=qAPEV98H_Cr9epJpQpbylg,date=Wed, 16 Feb 2022 13:05:14 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: errors {
  error_code {
    request_error: UNKNOWN
  }
  message: "The error code is not in this version."
  trigger {
    int64_value: 7095033345
  }
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "user_list"
    }
    field_path_elements {
      field_name: "user_list"
    }
  }
}
request_id: "qAPEV98H_Cr9epJpQpbylg"

Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.
Exception in thread "main" com.google.ads.googleads.v9.errors.GoogleAdsException: errors {
  error_code {
    request_error: UNKNOWN
  }
  message: "The error code is not in this version."
  trigger {
    int64_value: 7095033345
  }
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "user_list"
    }
    field_path_elements {
      field_name: "user_list"
    }
  }
}
request_id: "qAPEV98H_Cr9epJpQpbylg"

        }
Questions:-
is it right way to set bid modifier for user list in Ad Group?
Not able to get failure reason from error message. How do we get more info 

Google Ads API Forum Advisor

unread,
Feb 17, 2022, 3:55:16 AM2/17/22
to paid.m...@gmail.com, adwor...@googlegroups.com

Hello,

 

I'm Kevin from the Google Ads API Team.

 

Before we can provide proper context with regard to your question, can you provide the complete request and response logs with request ID so I can further investigate? I suggest that you upgrade as well to v10 of the Google Ads API as this might help us investigate the issue faster. You may send the requested information via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

 

Regards,

Google Logo
Kevin Gil
Google Ads API Team
 


ref:_00D1U1174p._5004Q2WwF7C:ref

Paid Media

unread,
Feb 17, 2022, 6:03:23 AM2/17/22
to Google Ads API and AdWords API Forum
Hi Kevin,

Our requirement is to add multiple customer match user lists with an Ad group for targeting and then set the different bid modifiers for this user list at the Ad group level.

I thought we will make multiple AdGroupCriterion service calls to add each user list to the Ad Group and set a bid modifier for it. To start with, made a single AdGroupCriterion service call to add a user list to the Ad Group and set a bid modifier for it.

Thank you 
Reply all
Reply to author
Forward
0 new messages