Problem creating tailored audience expansion/exclusion targeting with V1 API


#1

Hi, I am experiencing that when I try to create a tailored audience expansion/exclusion targeting criteria with the V1 batch endpoint, it seems always returning a normal targeting criterion (not expanded/excluded) regardless of the parameters. Any Idea?

Example - Expansion:
<=== [2016-07-18 21:25:56 +0000 :: ouylkq9r4 :: fn78 :: 1851862034] twurl -H ads-api.twitter.com -X POST -d "[{"operation_type":"Create","params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE","targeting_value":"18wy","tailored_audience_expansion":true}}]" "/1/batch/accounts/18ce53uuf0f/targeting_criteria" ===> [2016-07-18 21:25:56 +0000 :: ouylkq9r4 :: fn78 :: 200 OK :: 0.658s :: 299/300 (…60s)] {"data_type":"targeting_criterion","data":[{"line_item_id":"5q2t0","name":"Custom audience targeting","id":"9cgur1","tailored_audience_expansion":false,"operator_type":"EQ","created_at":"2016-07-18T21:10:22Z","targeting_value":"18wy","updated_at":"2016-07-18T21:10:22Z","tailored_audience_type":"CRM","deleted":false,"targeting_type":"TAILORED_AUDIENCE"}],"request":[{"params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE","targeting_value":"18wy","account_id":"18ce53uuf0f"},"operation_type":"Create"}]}

Example - Exclusion:
<=== [2016-07-18 21:27:45 +0000 :: ouylkq9r4 :: bzx0 :: 1851862034] twurl -H ads-api.twitter.com -X POST -d "[{"operation_type":"Create","params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE","targeting_value":"18wy","tailored_audience_type":"EXCLUDED_CRM"}}]" "/1/batch/accounts/18ce53uuf0f/targeting_criteria" ===> [2016-07-18 21:27:46 +0000 :: ouylkq9r4 :: bzx0 :: 200 OK :: 1.016s :: 299/300 (…60s)] {"data_type":"targeting_criterion","data":[{"line_item_id":"5q2t0","name":"Custom audience targeting","id":"9cgur1","tailored_audience_expansion":false,"operator_type":"EQ","created_at":"2016-07-18T21:10:22Z","targeting_value":"18wy","updated_at":"2016-07-18T21:10:22Z","tailored_audience_type":"CRM","deleted":false,"targeting_type":"TAILORED_AUDIENCE"}],"request":[{"params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE","targeting_value":"18wy","account_id":"18ce53uuf0f"},"operation_type":"Create"}]}


Ads API Version 3
#5

Hi, @etam. Sorry about the delay on this issue.

Thank you for providing the example requests and responses. This is really helpful.

For the tailored audience expansion, it turns out, the targeting_type should TAILORED_AUDIENCE_EXPANDED. So, your first request would become:

$ twurl -H ads-api.twitter.com --header "Content-Type: application/json" -X POST -d '[{"operation_type":"Create","params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE_EXPANDED","targeting_value":"18wy"}}]' "/1/batch/accounts/18ce53uuf0f/targeting_criteria"

(Note: I added --header "Content-Type: application/json" for brevity.)

For the tailored audience exclusion, while POST accounts/:account_id/targeting_criteria lists the tailored_audience_type param and the EXCLUDED_CRM value, the way to create this using the batch end point is slightly different. Instead, use the operator_type param and a value of NE. The exclusion request would become:

$ twurl -H ads-api.twitter.com --header "Content-Type: application/json" -X POST -d '[{"operation_type":"Create","params":{"line_item_id":"5q2t0","targeting_type":"TAILORED_AUDIENCE","targeting_value":"18wy","operator_type":"NE"}}]' "/1/batch/accounts/18ce53uuf0f/targeting_criteria"

The response should look something like the following:

{
  "data_type":"targeting_criterion",
  "data":[
    {
      "line_item_id":"5q2t0",
      "name":"Custom audience targeting",
      "id":"zzzzz",
      "tailored_audience_expansion":false,
      "operator_type":"NE",
      "created_at":"2016-08-10T23:02:49Z",
      "targeting_value":"18wy",
      "updated_at":"2016-08-10T23:02:49Z",
      "tailored_audience_type":"EXCLUDED_CRM",
      "deleted":false,
      "targeting_type":"TAILORED_AUDIENCE"
    }
  ],
  "request":[
    {
      "params":{
        "line_item_id":"5q2t0",
        "account_id":"18ce53uuf0f",
        "operator_type":"NE",
        "targeting_value":"18wy",
        "targeting_type":"TAILORED_AUDIENCE"
      },
      "operation_type":"Create"
    }
  ]
}

I hope this helps!

This is not clear in our documentation. We will update this soon.