Issues with Location Targeting Criteria


#1

When specifying targeting criteria for a new campaign, we are seeing issues with specifying locations as targeting criteria. We are retrieving locations from the targeting_criteria/locations endpoint. Any help in troubleshooting this issue?

For example, it is throwing the following error: “Expected valid targeting_value, got “34160e1f6e180cca” for targeting_value”


#2

Could you provide more information?

Give us the raw request for this request and also for the request where you get that targeting value.

Regards


#3

Here is the request that fetches the targeting value and also the request that its trying to create the targeting criteria for the campaign with that value. Could that inconsistency could be related with the fact that sandbox mode doesn’t have targeting criteria data up to date?

REQUEST that gets the targeting value from twitter

URL: https://ads-api.twitter.com/0/targeting_criteria/locations
Body:
{ q: ‘IL’, count: 1000 }

Response:
[

{
“name”:“Ilkadim, Samsun, Turkey”,
“targeting_type”:“LOCATION”,
“targeting_value”:“1a8b70e8164a6d74”,
“location_type”:“REGION”
}

]

REQUEST that tries to save the targeting criteria

URL: https://ads-api-sandbox.twitter.com/0/accounts/gq10ri/targeting_criteria

Body:
{
“params”: {
“line_item_id”:“d4ft”,
“targeting_type”:“LOCATION”,
“targeting_value”:“1a8b70e8164a6d74”,
“account_id”:“gq10ri”
}
}

Response:
ERROR [INVALID_RESPONSE_CODE] {“status_code”:400,“body”:{“errors”:[{“code”:“INVALID_PARAMETER”,“message”:“Expected valid targeting_value, got “1a8b70e8164a6d74” for targeting_value”,“parameter”:“targeting_value”}],“request”:{“params”:{“line_item_id”:“d4ft”,“targeting_type”:“LOCATION”,“targeting_value”:“1a8b70e8164a6d74”,“account_id”:“gq10ri”}}}}


#4

That’s the mistake!, Ads Api Sandbox doesn’t has all the locations