How to set "language" targeting_criteria?


I cann’t find something like “language” within “targeting_type” of POST accounts/:account_id/targeting_criteria API.

How to set “language” targeting_criteria ?


Good question,

To do this, use the LANGUAGE enum as the targeting_type and an ISO 639-1 value as the targeting_value.

$ twurl -X POST -H "/2/accounts/18ce54d4x5t/targeting_criteria?line_item_id=a4np2&targeting_type=LANGUAGE&targeting_value=en" | jq
  "data": {
    "line_item_id": "a4np2",
    "name": "English",
    "id": "fsnckd",
    "account_id": "18ce54d4x5t",
    "created_at": "2017-10-13T04:06:09Z",
    "targeting_value": "en",
    "updated_at": "2017-10-13T04:06:09Z",
    "deleted": false,
    "targeting_type": "LANGUAGE"
  "request": {
    "params": {
      "line_item_id": "a4np2",
      "targeting_type": "LANGUAGE",
      "targeting_value": "en",
      "account_id": "18ce54d4x5t"

We realize this could be clearer in the documentation. We’ll add the LANGUAGE enum to the parameter table.



@juanshishido: Just a reminder to do this, please. I ran into the same problem now.


Thanks for the reminder, @majoritasdev!


@majoritasdev: We’ve added LANGUAGE to the docs.


:slight_smile: Thank you, @juanshishido!

I think you can mark this as solved, by your first post in this topic, if you want.

Thank you again! :slight_smile: