I have encountered another bug with the batch targeting criteria endpoint, specifically with Tailored Audiences. Once an excluded tailored audience target is created, you are never able to add that tailored audience as an included target, even after you delete the original excluded target
Here is a scenario to help illustrate:
- I add an Excluded Tailored Audience target to my line item:
twurl -X POST -r '[{"operation_type":"Create","params": {"line_item_id":"8dqoj","targeting_type":"TAILORED_AUDIENCE","targeting_value":"v0ss","operator_type":"NE"}}]' -A 'Content-Type: application/json' -H 'ads-api.twitter.com' '/1/batch/accounts/XXXXXX/targeting_criteria' | jq
{
"data_type": "targeting_criterion",
"data": [
{
"line_item_id": "8dqoj",
"name": "Custom audience targeting",
"id": "dwd61x",
"tailored_audience_expansion": false,
"operator_type": "NE",
"created_at": "2017-06-05T21:38:46Z",
"targeting_value": "v0ss",
"updated_at": "2017-06-05T21:38:46Z",
"tailored_audience_type": "EXCLUDED_CRM",
"deleted": false,
"targeting_type": "TAILORED_AUDIENCE"
}
],
"request": [
{
"params": {
"line_item_id": "8dqoj",
"account_id": "XXXXXX",
"operator_type": "NE",
"targeting_value": "v0ss",
"targeting_type": "TAILORED_AUDIENCE"
},
"operation_type": "Create"
}
]
}
- I change my mind and remove the tailored audience target I just created:
twurl -X POST -r '[{"operation_type": "Delete","params": {"line_item_id": "8dqoj","targeting_criterion_id": "dwd61x"}}]' -A 'Content-Type: application/json' -H 'ads-api.twitter.com' '/1/batch/accounts/XXXXXX/targeting_criteria' | jq
{
"data_type": "targeting_criterion",
"data": [
{
"line_item_id": "8dqoj",
"name": "Custom audience targeting",
"id": "dwd61x",
"tailored_audience_expansion": false,
"operator_type": "NE",
"created_at": "2017-06-05T21:38:46Z",
"targeting_value": "v0ss",
"updated_at": "2017-06-05T22:05:35Z",
"tailored_audience_type": "EXCLUDED_CRM",
"deleted": true,
"targeting_type": "TAILORED_AUDIENCE"
}
],
"request": [
{
"params": {
"targeting_criterion_id": "dwd61x",
"account_id": "XXXXXX"
},
"operation_type": "Delete"
}
]
}
- Next, I decide that I actually want to include that same tailored audience, so I send a new target create request:
twurl -X POST -r '[{"operation_type":"Create","params": {"line_item_id":"8dqoj","targeting_type":"TAILORED_AUDIENCE","targeting_value":"v0ss","operator_type":"EQ"}}]' -A 'Content-Type: application/json' -H 'ads-api.twitter.com' '/1/batch/accounts/XXXXXX/targeting_criteria' | jq
{
"data_type": "targeting_criterion",
"data": [
{
"line_item_id": "8dqoj",
"name": "Custom audience targeting",
"id": "dwd61x",
"tailored_audience_expansion": false,
"operator_type": "NE",
"created_at": "2017-06-05T21:38:46Z",
"targeting_value": "v0ss",
"updated_at": "2017-06-05T22:09:04Z",
"tailored_audience_type": "EXCLUDED_CRM",
"deleted": false,
"targeting_type": "TAILORED_AUDIENCE"
}
],
"request": [
{
"params": {
"line_item_id": "8dqoj",
"account_id": "XXXXXX",
"operator_type": "EQ",
"targeting_value": "v0ss",
"targeting_type": "TAILORED_AUDIENCE"
},
"operation_type": "Create"
}
]
}
Here is where I encounter the bug. Notice that my request asks to add an included CRM (with the provided "operator_type": "EQ" attribute). The request succeeds, but the target that is created is an EXCLUDED_CRM target.
@juanshishido, can you confirm this on your end?