When I try to add a UserInterest, I am getting the Invalid user interest criterion error

466 views
Skip to first unread message

Binu Mathew

unread,
Oct 24, 2021, 10:38:53 PM10/24/21
to AdWords API and Google Ads API Forum
Hello

When I try to add a UserInterest, I am getting the following error

61700784, RequestId: "Vcrte0UiVrR6n5GS6cTNeg", IsFault: 0, FaultMessage: "None"
[2021-10-23T16:18:53.166929+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v7.services.CampaignCriterionService/MutateCampaignCriteria", CustomerId: 1861700784, RequestId: "ib6vx9wry5cy7LynWcrgiA", IsFault: 1, FaultMessage: "["Invalid user interest criterion."]"
[2021-10-23T16:18:53.170816+00:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v7.services.CampaignCriterionService/MutateCampaignCriteria
Headers: {
    "x-goog-api-client": "gl-php\/7.4.19 gapic\/ gax\/1.7.1 grpc\/1.38.0",
    "x-goog-request-params": "customer_id=1861700784",
    "developer-token": "REDACTED",
    "login-customer-id": "4888128700"
}
Request:
{"customerId":"1861700784","operations":[{"create":{"campaign":"customers\/1861700784\/campaigns\/15043066062","negative":true,"userInterest":{"userInterestCategory":"customers\/1861700784\/userInterests\/730"}}}]}

Response
-------
Headers: {
    "request-id": "ib6vx9wry5cy7LynWcrgiA",
    "date": "Sat, 23 Oct 2021 16:18:53 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"
}

Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"criterionError":"INVALID_USER_INTEREST"},"message":"Invalid user interest criterion.","trigger":{"int64Value":"730"},"location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"create"},{"fieldName":"user_interest"},{"fieldName":"user_interest_category"}]}}],"requestId":"ib6vx9wry5cy7LynWcrgiA"}


I developing the app using PHP
$userInterestName = 'customers/1861700784/userInterests/730';
$campaignCriterion = new CampaignCriterion([
            'user_interest' => new UserInterestInfo([
                'user_interest_category' => $userInterestName
            ]),
            'negative' => true, 
            'campaign' => $campaignResourceName
        ]);
 $campaignCriterionOperation = new CampaignCriterionOperation();
$campaignCriterionOperation->setCreate($campaignCriterion);
$campaignCriterionServiceClient = $googleAdsClient->getCampaignCriterionServiceClient();

$response = $campaignCriterionServiceClient->mutateCampaignCriteria( 1861700784  , $operations);

Any Idea why?

Google Ads API Forum Advisor

unread,
Oct 25, 2021, 10:31:28 AM10/25/21
to binumat...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Some criterion are only valid for certain campaign types. You can query the UserInterest availabilities attribute to check the availability based on context. 

Please let us know if you have any other questions on this. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 
 

ref:_00D1U1174p._5004Q2QErXa:ref
Reply all
Reply to author
Forward
0 new messages