UNEXPECTED_INTERNAL_API_ERROR for AdGroupCriterionService

176 views
Skip to first unread message

Nima Mirbakhsh

unread,
Jan 17, 2018, 12:59:15 AM1/17/18
to AdWords API Forum
Hi there,

I am trying to add a CriterionUserInterest using AdGroupCriterionService, I can add Gender, Age, etc. using a similar method but I receive `UNEXPECTED_INTERNAL_API_ERROR` for CriterionUserInterest. Here is my code:

const adGroupService = adwordsServices.getService('AdGroupCriterionService''v201710');

const operation = {

    operator: 'ADD',

    operand: {

        adGroupId: adGroupId,

        'xsi:type''AdGroupCriterion',

        criterion: {

            'xsi:type': 'CriterionUserInterest',

            id: '80675'

        }

    }

};

return adGroupService.mutate({operations: [operation]}, (error, result) => ...


I was wondering if you can help me with this.


Thank you in advance,


Nima

Luis Xander Talag (AdWords API Team)

unread,
Jan 17, 2018, 1:58:25 AM1/17/18
to AdWords API Forum
Hi Nima,

The UNEXPECTED_INTERNAL_API_ERROR error you encountered could be due to a temporary resource related issues in the AdWords API server or a possible bug. Could you confirm if you are still encountering this issue as of now? If you can confirm this, could you provide the SOAP request and response logs so that I can further investigate this? If you haven't enabled the SOAP logs yet, kindly see this guide on how to log SOAP interactions in Python. Please reply using Reply privately to author for security purposes.

Thanks and regards,
Luis
AdWords API Team

Nima Mirbakhsh

unread,
Jan 17, 2018, 9:33:37 AM1/17/18
to AdWords API Forum
Hi Luis,

Yes, I still receive the same error. I am coding in Node and using this package: https://www.npmjs.com/package/node-adwords to connect to the api.

As I mentioned before, I can create campaigns, adwords, and other criterions for gender, age, etc. with no error. Here is the SOAP request:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="https://adwords.google.com/api/adwords/cm/v201710" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">

<soap:Header>

<ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201710" xmlns="https://adwords.google.com/api/adwords/cm/v201710">

<ns1:developerToken>xxxxx</ns1:developerToken>

<ns1:userAgent>xxxxx</ns1:userAgent>

<ns1:validateOnly>false</ns1:validateOnly>

<ns1:clientCustomerId>xxx-xxx-xxxx</ns1:clientCustomerId>

</ns1:RequestHeader>

</soap:Header>

<soap:Body>

<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201710">

<operations>

<operator>ADD</operator>

<operand xsi:type="AdGroupCriterion">

<adGroupId>xxxxxxxx</adGroupId>

<criterion xsi:type="CriterionUserInterest">

<id>80675</id>

</criterion>

</operand>

</operations>

</mutate>

</soap:Body>

</soap:Envelope>


Error:


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Header>

<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201710">

<requestId>000562f9926f88780a017e03a0048c41</requestId>

<serviceName>AdGroupCriterionService</serviceName>

<methodName>mutate</methodName>

<operations>1</operations>

<responseTime>597</responseTime>

</ResponseHeader>

</soap:Header>

<soap:Body>

<soap:Fault>

<faultcode>soap:Server</faultcode>

<faultstring>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</faultstring>

<detail>

<ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201710">

<message>

[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</message>

<ApplicationException.Type>ApiException</ApplicationException.Type>

<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="InternalApiError">

<fieldPath>

</fieldPath>

<trigger></trigger>

<errorString>InternalApiError.UNEXPECTED_INTERNAL_API_ERROR</errorString><ApiError.Type>InternalApiError</ApiError.Type><reason>UNEXPECTED_INTERNAL_API_ERROR</reason>

</errors>

</ApiExceptionFault>

</detail>

</soap:Fault>

</soap:Body>

</soap:Envelope>


Thanks,

Nima


Luis Xander Talag (AdWords API Team)

unread,
Jan 18, 2018, 12:46:26 AM1/18/18
to AdWords API Forum
Hi Nima,

Thank you for providing these details. Based on your SOAP logs, you should use the userInterestId instead of the id field because this is a required field when using the CriterionUserInterest object. Also take note that you should use the BiddableAdGroupCriterion as your operand instead of the AdGroupCriterion. You may check this sample code (also available in other languages) for reference. If you still encounter an error, kindly provide again your SOAP request and response logs so that I can further investigate the issue and reply using Reply privately to author.

Luis Xander Talag (AdWords API Team)

unread,
Jan 18, 2018, 10:45:39 PM1/18/18
to AdWords API Forum
Hi Nima,

The error CANNOT_ADD_CRITERIA_TYPE means that the criteria type cannot be targeted for the ad group. Either the account is restricted to keywords only, the criteria type is incompatible with the campaign's bidding strategy, or the criteria type can only be applied to campaigns. To further investigate this issue, could you provide your clientCustomerId and adGroupId based on your SOAP logs? Please reply using Reply privately to author.

Luis Xander Talag (AdWords API Team)

unread,
Jan 22, 2018, 12:10:57 AM1/22/18
to AdWords API Forum
Hi Nima,

Upon checking on your account, the campaign where this adGroupId belongs is with a Search Network with Display Select as Campaign Type. As you can see in this guideCriterionUserInterest can be created using user interest category ID (In-market | Affinity) which is available via the Display Network only campaign type. Please keep in mind that audience targeting is not available for all campaign types. 

I suggest that if you want to create a CriterionUserInterest criterion, you should use a campaign with the Display Network only campaign type. Also, you may check the UI under Display Network > + TARGETING > Interests & remarketing > Select category on the available categories you can add in your campaign.

Let me know if this helps.

Kerwin Jorbina

unread,
Aug 13, 2018, 2:10:45 AM8/13/18
to AdWords API and Google Ads API Forum
Hi,

Any news on this? Were you able to make it work?

I am also trying to add the CriterionUserInterest to the adgroup of the campaign and I am encountering this error. I used 'Display'  as the advertising_channel_type.

The example code looks like this (please don't mind if there are syntax errors):

ad_group_criterion_service = client.service(:AdGroupCriterionService)
ad_group_criterion_service.mutate({
operator: 'ADD',
operand: {
xsi_type: 'BiddableAdGroupCriterion',
ad_group_id: some_number,
criterion: {
xsi_type: 'CriterionUserInterest',
id: id
}
}
})


I tried to change the id to userInterestId also but I am getting an error that userInterestId is not recognized.

I have tried to hard code the id also from the values that is included in the following: 
Can someone help me?

Luis Xander Talag (AdWords API Team)

unread,
Aug 13, 2018, 3:20:43 AM8/13/18
to AdWords API and Google Ads API Forum
Hi Kerwin,

To better investigate your issue, could you provide the complete SOAP request and response logs when you encountered the error? Please reply via Reply privately to author.

Thanks and regards,
Luis
AdWords API Team

Reply all
Reply to author
Forward
0 new messages