Hi Mahmut,
Thank you for reaching out to Google Ads API support. I tried set_up_marketing.py on a standard Display campaign in a test account and got your error. This matches what the UI offers, you can only attach audiences in standard display campaigns at ad group level. This is also true in non test accounts. Note that the sample set_up_marketing.py first adds the user list as a criterion at ad group level, then removes it, then attempts to add it a campaign level. If the only error you received was at campaign level then this shows that the ad group can be targeted with this list.
Regarding targeting exclusively your userlist, you may
add the audience targeting dimension with bid only set to false.
Demographic dimensions are in an either-or state; they're always either targeted or excluded, which is different from other criteria, which could be targeted, excluded, or not set up at all. This means that when you create a new ad group, all demographic dimensions are created automatically, and set to be targeted.
Note that when you update the targeting settings, you must specify an exhaustive list of all targeting settings you want; there is no way to just specify a single new targeting setting. Since you can't remove the demographic ones, when you try to update a targeting setting for an unrelated criterion type, the system sees that you're "trying to remove demographic targeting" (which is just a side effect of the fact that you didn't specify it explicitly), and disallows the entire request.
The workaround for now is to fetch the existing list of targeting settings before you attempt your update, and make sure you include all the existing ones along with the new one you want to add.
Here's a REST representation of an update to a targeting setting:
curl -i --request POST https://googleads.googleapis.com/v10/customers/<CUSTOMER ID PLACEHOLDER>/adGroups:mutate \
--header "Content-Type: application/json" \
--header "login-customer-id: <LOGIN CUSTOMER ID PLACEHOLDER>" \
--header "developer-token: <DEVELOPER TOKEN PLACEHOLDER>" \
--header "Authorization: Bearer <ACCESS TOKEN PLACEHOLDER>" \
--data '{
"operations": [
{ "updateMask":"targetingSetting.targetRestrictions",
"update": {
"resourceName": "customers/<CUSTOMER ID PLACEHOLDER>/adGroups/<ADGROUP ID PLACEHOLDER>",
"targetingSetting": {
"targetRestrictions": [
{
"targetingDimension": "AUDIENCE",
"bidOnly": false
},
{
"targetingDimension": "PLACEMENT",
"bidOnly": false
},
{
"targetingDimension": "TOPIC",
"bidOnly": false
},
{
"targetingDimension": "AGE_RANGE",
"bidOnly": true
},
{
"targetingDimension": "GENDER",
"bidOnly": true
},
{
"targetingDimension": "PARENTAL_STATUS",
"bidOnly": true
},
{
"targetingDimension": "INCOME_RANGE",
"bidOnly": true
}
]
},
},
}
],
"responseContentType": "MUTABLE_RESOURCE"
}
'
Regards,
 |
Aryeh |
Google Ads API Team |
|
|
|

ref:_00D1U1174p._5004Q2Wz4re:ref