灵活定位

通过在 flexible_spec 中使用 ANDOR 语句,来组合使用或排除不同定位选项,以覆盖特定的用户群体。Facebook 通过在 flexible_spec 中使用 AND 语句,将此参数与此参数以外的所有定位细分条件(如年龄、性别、地理位置)组合起来,来评估定位。我们还在 flexible_spec 中使用 AND 来评估每个顶级数组元素,使用 OR 来评估次级数组元素。

定位细分条件(如 flexible_spec 中指定的行为)只能在 flexible_spec 中使用。

可用字段

按以下方式指定 flexible_specexclusions

字段 描述

flexible_spec

类型:JSON 对象

一组数组。每个数组都包含采用适当格式的定位细分条件,例如兴趣、行为和人口统计数据。顶级数组上限为 25,次级数组上限为 1,000。

exclusions

类型:JSON 对象

包含采用适当格式的定位细分条件,例如兴趣、行为和人口统计数据(“教育”、“生活纪事”、“工作”)。

在灵活定位中,可使用以下字段:

  • custom_audiences
  • interests
  • behaviors
  • college_years
  • education_majors
  • education_schools
  • education_statuses
  • family_statuses
  • income
  • industries
  • life_events
  • user_adclusters
  • work_positions
  • work_employers

示例

灵活定位

如要将目标受众定位为以下用户:在美国居住、年龄介于 18-43 岁之间,近期搬家,是旅行者或喜欢足球或电影,刚结婚不久或喜欢音乐:

curl \
  -F 'name=My AdSet' \
  -F 'optimization_goal=REACH' \
  -F 'billing_event=IMPRESSIONS' \
  -F 'bid_amount=150' \
  -F 'daily_budget=2000' \
  -F 'campaign_id=<CAMPAIGN_ID>' \
  -F 'targeting={ 
    "age_max": 43, 
    "age_min": 18, 
    "exclusions": { 
      "relationship_statuses": [1,3], 
      "life_events": [{"id":6003054185372,"name":"Recently moved"}] 
    }, 
    "flexible_spec": [ 
      { 
        "behaviors": [{"id":6002714895372,"name":"Frequent Travelers"}], 
        "interests": [ 
          {"id":6003107902433,"name":"Association football (Soccer)"}, 
          {"id":6003139266461,"name":"Movies"} 
        ] 
      }, 
      { 
        "interests": [{"id":6003020834693,"name":"Music"}], 
        "life_events": [{"id":6002714398172,"name":"Newlywed (1 year)"}] 
      } 
    ], 
    "geo_locations": {"countries":["US"]} 
  }' \
  -F 'status=ACTIVE' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets

使用此定位参数将获得以下受众:

(segment1 or segment2 or segment3) and (segment4 or segment5) and segment6

flexible_spec=
[
  {
    'segment_type':[segment1, segment2], 
    'segment_type':[segment3]
  },
  { 
    'segment_type':[segment4, segment5]
  },
  { 
    'segment_type':[segment6]
  }
]

含排除参数的灵活定位

例如:创建以下受众:在美国居住、年龄介于 20-24 岁之间,近期搬家,是旅行者或喜欢足球或电影,刚结婚不久或喜欢音乐:

targeting=
{'geo_locations':{ 
  'countries': ['US'], 
}, 
'age_min':20, 
'age_max':24, 
'flexible_spec': [ 
  {
    'behaviors':[{'id':6002714895372,'name':'Frequent Travelers'},], 
    'interests':[ 
      {'id':6003107902433,'name':'Association football (Soccer)'}, 
      {'id':6003139266461, 'name': 'Movies'},],  
  }, 
  {
    'life_events':[{'id': 6002714398172, 'name': 'Newlywed (1 year)'}],
    'interests':[{'id':6003020834693,'name':'Music'},], 
  },   
], 
'exclusions': { 
  'life_events':[{'id':6003054185372,'name':'Recently moved'},], 
}, 
} 

该广告组的定位参数将如以下所示:

{
  "targeting": { 
    "age_min": 20, 
    "age_max": 24,
    "exclusions": {
      "life_events": [
        {
          "id": "6003054185372", 
          "name": "Recently moved"
        }
      ], 
    }, 
    "flexible_spec": [
      {
        "interests": [
          {
            "id": "6003107902433", 
            "name": "Association football (Soccer)"
          }, 
          {
            "id": "6003139266461", 
            "name": "Movies"
          }
        ], 
        "behaviors": [
          {
            "id": "6002714895372", 
            "name": "Frequent Travelers"
          }
        ]
      }, 
      {
        "interests": [
          {
            "id": "6003020834693", 
            "name": "Music"
          }
        ],       
        "life_events": [
          {
            "id": "6002714398172", 
            "name": "Newlywed (1 year)"
          }
        ]
      }
    ], 
    "geo_locations": {
      "countries": [
        "US"
      ]
    }
  }, 
  "id": "6015417075447"
}