Add new audience to existing group with Observation type option

100 views
Skip to first unread message

Miguel Graciá

unread,
Mar 12, 2020, 12:59:34 PM3/12/20
to AdWords API and Google Ads API Forum
Hi all.

I have multiple ad groups created by google ads api using php library. In these groups, assign audiences using the class and assigning AdGroupCriterion interest with setUserInterest function. I would like to set the "Observation" type in creating the audience but I can't find any function in the AdGroupCriterion and UserInterestInfo classes to help me assign that value.
Could you please help me or tell me how to do it?

Screenshot from 2020-03-12 17-52-13.png

Thank you!

Google Ads API Forum Advisor Prod

unread,
Mar 13, 2020, 11:17:08 AM3/13/20
to miguelgra...@gmail.com, adwor...@googlegroups.com
Hi Miguel,

You can set the TargetRestriction of the TargetingSetting to set the Targeting or Observation.

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UXUudJ:ref

Miguel Graciá

unread,
Mar 16, 2020, 11:17:34 AM3/16/20
to AdWords API and Google Ads API Forum
Hi Anthony.

Thanks for your answer.

When i try to create the group i get the following

[2020-03-16 14:45:16] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v2.services.AdGroupService/MutateAdGroups", ClientCustomerId: [customer_id], RequestId: "LBZObh-LWizCoQ_XKH5axQ", IsFault: 1, FaultMessage: "["The supplied TargetingSetting contains an invalid CriterionTypeGroup. See CriterionTypeGroup documentation for CriterionTypeGroups allowed in Campaign or AdGroup TargetingSettings."]"  
[2020-03-16 14:45:16] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v2.services.AdGroupService/MutateAdGroups
Host: googleads.googleapis.com
Headers: {
   
"x-goog-api-client": "gl-php\/7.1.33-13+0~20200224.34+debian9~1.gbp2471e1 gapic\/ gax\/1.3.0 grpc\/1.27.0",
   
"x-goog-request-params": "customer_id=[customer_id]",
   
"developer-token": "REDACTED",
   
"login-customer-id": "[login_customer_id]"
}
Request: {"customerId":"[customer_id]","operations":[{"create":{"name":"group text0.01890000 1584369913","status":"PAUSED","type":"SEARCH_STANDARD","campaign":"customers\/[customer_id]\/campaigns\/[campaign_id]","targetingSetting":{"targetRestrictions":[{"targetingDimension":"KEYWORD","bidOnly":true},{"targetingDimension":"AUDIENCE","bidOnly":true}]}}}]}

Response
-------
Headers: {
   
"request-id": "LBZObh-LWizCoQ_XKH5axQ",
   
"date": "Mon, 16 Mar 2020 14:45:16 GMT",
   
"alt-svc": "quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":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":{"settingError":"TARGETING_SETTING_CONTAINS_INVALID_CRITERION_TYPE_GROUP"},"message":"The supplied TargetingSetting contains an invalid CriterionTypeGroup. See CriterionTypeGroup documentation for CriterionTypeGroups allowed in Campaign or AdGroup TargetingSettings.","trigger":{"stringValue":"KEYWORD"},"location":{"fieldPathElements":[{"fieldName":"operations","index":"0"},{"fieldName":"create"},{"fieldName":"targeting_setting"}]}}]}

I tried to use the example from this link, but it doesn't work because I use the new google ads api.

Please, could you give me some example of use with the new api?

Thanks for your help

Google Ads API Forum Advisor Prod

unread,
Mar 16, 2020, 4:15:48 PM3/16/20
to miguelgra...@gmail.com, adwor...@googlegroups.com
Hi Miguel,

Unfortunately, we don't have any examples on setting this setting via Google Ads API. However, the error you are facing is because you trying to set the targeting setting of a keyword group. Your operation on audience looks to have no issues.

Miguel Graciá

unread,
Mar 17, 2020, 5:37:14 AM3/17/20
to AdWords API and Google Ads API Forum
Hi Anthony

I removed the keyword constraint and the group was created successfully.

Thanks four your help.

Regards

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