Unable To Create Tailored Audience Expansion using Batch Targeting


#1

https://ads-api.twitter.com/1/batch/accounts/18t5pf/targeting_criteria/

requestBody=[{“params”:{“targeting_type”:“LOCATION”,“line_item_id”:“6e0kn”,“targeting_value”:“96683cc9126741d1”,“negated”:false,“deleted”:false,“operator_type”:“EQ”,“tailored_audience_expansion”:false},“operation_type”:“Create”},{“params”:{“targeting_type”:“TAILORED_AUDIENCE”,“line_item_id”:“6e0kn”,“targeting_value”:“1ek72”,“negated”:false,“deleted”:false,“operator_type”:“EQ”,“tailored_audience_expansion”:false},“operation_type”:“Create”},{“params”:{“targeting_type”:“TAILORED_AUDIENCE”,“line_item_id”:“6e0kn”,“targeting_value”:“188wv”,“negated”:false,“deleted”:false,“operator_type”:“EQ”,“tailored_audience_expansion”:true},“operation_type”:“Create”}]

Response
{“data_type”:“targeting_criterion”,“data”:[{“line_item_id”:“6e0kn”,“name”:“United States”,“id”:“a72tnt”,“location_type”:“COUNTRY”,“operator_type”:“EQ”,“created_at”:“2016-10-04T10:01:30Z”,“targeting_value”:“96683cc9126741d1”,“updated_at”:“2016-10-04T10:01:30Z”,“deleted”:false,“targeting_type”:“LOCATION”},{“line_item_id”:“6e0kn”,“name”:“Retargeting custom audience targeting”,“id”:“a72tnu”,“tailored_audience_expansion”:false,“operator_type”:“EQ”,“created_at”:“2016-10-04T10:01:30Z”,“targeting_value”:“1ek72”,“updated_at”:“2016-10-04T10:01:30Z”,“tailored_audience_type”:“WEB”,“deleted”:false,“targeting_type”:“TAILORED_AUDIENCE”},{“line_item_id”:“6e0kn”,“name”:“Retargeting custom audience targeting”,“id”:“a72tnv”,“tailored_audience_expansion”:false,“operator_type”:“EQ”,“created_at”:“2016-10-04T10:01:30Z”,“targeting_value”:“188wv”,“updated_at”:“2016-10-04T10:01:30Z”,“tailored_audience_type”:“WEB”,“deleted”:false,“targeting_type”:“TAILORED_AUDIENCE”}],“request”:[{“params”:{“line_item_id”:“6e0kn”,“account_id”:“18t5pf”,“operator_type”:“EQ”,“targeting_value”:“96683cc9126741d1”,“targeting_type”:“LOCATION”},“operation_type”:“Create”},{“params”:{“line_item_id”:“6e0kn”,“account_id”:“18t5pf”,“operator_type”:“EQ”,“targeting_value”:“1ek72”,“targeting_type”:“TAILORED_AUDIENCE”},“operation_type”:“Create”},{“params”:{“line_item_id”:“6e0kn”,“account_id”:“18t5pf”,“operator_type”:“EQ”,“targeting_value”:“188wv”,“targeting_type”:“TAILORED_AUDIENCE”},“operation_type”:“Create”}]}

We need to set an audience expansion but it seems from the response that the audience has been set as a normal Tailored Audience type. If you check we are sending “tailored_audience_expansion” field as true for “targeting_value”:“188wv” with “targeting_type”:“TAILORED_AUDIENCE”.


Ads API Version 3
#2

@abhishek_pyro: Thanks for the question.

For the tailored audience expansion, the targeting_type should be TAILORED_AUDIENCE_EXPANDED.

Unfortunately, this has not yet been documented.The documentation exists here: POST accounts/:account_id/targeting_criteria

Please let us know if this helps.


#5

@abhishek_pyro: Did this resolve the issue?


#6

Hey, It didn’t work :frowning:

HttpRequest{requestMethod=POST, url=‘https://ads-api.twitter.com/1/batch/accounts/18t5pf/targeting_criteria/’, postParams=[], authentication=OAuthAuthorization{consumerKey=‘TP7ebHOCMLv9Xd9nkT20Q’, consumerSecret=’******************************************’, oauthToken=AccessToken{screenName=‘null’, userId=23996599}}, requestHeaders={X-Twitter-Client-URL=https://twitter4j.org/en/twitter4j-3.0.4-SNAPSHOT.xml, X-Twitter-Client=Twitter4J, Accept-Encoding=gzip, User-Agent=twitter4j https://twitter4j.org/ /3.0.4-SNAPSHOT, X-Twitter-Client-Version=3.0.4-SNAPSHOT}, requestBody=[{“params”:{“targeting_type”:“TAILORED_AUDIENCES_EXPANDED”,“line_item_id”:“6gp3b”,“targeting_value”:“1ek70”,“negated”:false,“deleted”:false,“tailored_audience_expansion”:false},“operation_type”:“Create”}]}

Response

{“request”:[{“params”:{“line_item_id”:“6gp3b”,“account_id”:“18t5pf”},“operation_type”:“Create”}],“operation_errors”:[[{“code”:“INVALID_PARAMETER”,“message”:“Expected valid targeting type, got “TAILORED_AUDIENCES_EXPANDED” for targeting_type”,“parameter”:“targeting_type”},{“code”:“INVALID_PARAMETER”,“message”:“Expected Long, got “1ek70” for targeting_value”,“parameter”:“targeting_value”}]]}


#7

Hey @abhishek_pyro,

Apologies for the confusion, but the correct enum value is TAILORED_AUDIENCES_EXPANDED

Can you try that and let us know if the API calls are working as expected?

Thanks!


#9

Just corrected the above post, @abhishek_pyro.


#10

@abhishek_pyro: Miscommunication on our part—what we stated originally was correct. The value should be TAILORED_AUDIENCE_EXPANDED (no S). This value is in the docs, as well.

We just took a closer look at the targeting_type param in the response you posted: looks like it’s misspecified.


#11

@juanshishido that helped, we are able to create the Targeting, really appreciate the help :slight_smile: