查询包含括号的facebook关键字

时间:2012-05-21 14:04:47

标签: facebook facebook-graph-api ads facebook-ads-api

我正在尝试使用facebook ads api查询facebook关键字 我的问题是关键字包含括号。在我将它发送到Facebook之前,我urlencode字符串,但它仍然不起作用 例如,如果我想查询居住在美国并且像Apple inc。一样的用户,我会查询以下网址:

https://graph.facebook.com/act_19720295/targetingsentencelines?targeting_spec={%22countries%22:[%22US%22],%22keywords%22:[%22Apple+Inc.%22]}&access_token=MY_ACCESS_TOKEN

结果如下:

{
   "params": {
      "countries": [
         "US"
      ],
      "keywords": [
         "apple inc"
      ]
   },
   "targetingsentencelines": [
      "who live in the United States",
      "who like apple inc"
   ]
}

如果我添加另一个包含括号“App Store(iOS)”的关键字,facebook会忽略它:

https://graph.facebook.com/act_19720295/targetingsentencelines?targeting_spec={%22countries%22:[%22US%22],%22keywords%22:[%22Apple+Inc.%22,%22App+Store+%28iOS%29%22,%22%22]}&access_token=MY_ACCESS_TOKEN

我仍然得到相同的结果:

{
   "params": {
      "countries": [
         "US"
      ],
      "keywords": [
         "apple inc"
      ]
   },
   "targetingsentencelines": [
      "who live in the United States",
      "who like apple inc"
   ]
}

有没有人知道为什么?

1 个答案:

答案 0 :(得分:1)

在关键字(“#app store(ios)”)之前添加'#'字符解决了问题。