AND
및 OR
구문을 사용해 서로 다른 타게팅 옵션을 결합하거나 제외하여 flexible_spec
의 특정 사용자 세트에 도달하세요. Facebook은 사양 외의 모든 세그먼트(예: 나이, 성별, 지역적 위치)와 함께 AND
를 사용해 flexible_spec
의 타게팅을 평가합니다. 또한 Facebook은 AND
를 이용해 flexible_spec
의 각 최상위 수준 배열 요소를 평가하고, OR
를 사용해 두 번째 수준 배열 요소를 평가합니다.
타게팅 세그먼트(예: flexible_spec
내에 지정된 행동)는 flexible_spec
외부에서 사용할 수 없습니다.
flexible_spec
및 exclusions
를 다음과 같이 지정합니다.
필드 | 설명 |
---|---|
유형: JSON 개체 | 배열의 배열입니다. 각각에는 적절한 형식의 타게팅 세그먼트(예: 관심사, 행동, 인구 통계학적 특성)가 포함됩니다. 최상위 수준 배열은 25개로 제한되고 두 번째 수준 배열은 1,000개로 제한됩니다. |
유형: JSON 개체 | 적절한 형식의 타게팅 세그먼트(예: 관심사, 행동, 인구 통계학적 특성('교육', '중요 이벤트', '일')를 포함합니다. |
유연한 타게팅에 사용하는 필드는 다음과 같습니다.
connections
friends_of_connections
custom_audiences
interests
behaviors
college_years
education_majors
education_schools
education_statuses
family_statuses
home_value
interested_in
income
industries
life_events
user_adclusters
work_positions
work_employers
18~43세 미국 거주자 중에서 최근에 이사를 가지 않았고 여행객이거나 축구 또는 영화를 좋아하고 신혼이거나 음악을 좋아하는 사용자를 타게팅합니다.
use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Values\AdSetBillingEventValues;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;
use FacebookAds\Object\Fields\TargetingFields;
use FacebookAds\Object\Targeting;
$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
AdSetFields::NAME => 'My AdSet',
AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REACH,
AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
AdSetFields::BID_AMOUNT => 150,
AdSetFields::DAILY_BUDGET => 2000,
AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
AdSetFields::TARGETING => (new Targeting())->setData(array(
TargetingFields::GEO_LOCATIONS => array(
'countries' => array(
'US',
),
),
TargetingFields::AGE_MIN => 18,
TargetingFields::AGE_MAX => 43,
TargetingFields::FLEXIBLE_SPEC => array(
array(
TargetingFields::BEHAVIORS => array(
array(
'id' => 6002714895372,
'name' => 'All travelers',
),
),
TargetingFields::INTERESTS => array(
array(
'id' => 6003107902433,
'name' => 'Association football (Soccer)',
),
array(
'id' => 6003139266461,
'name' => 'Movies',
),
),
),
array(
TargetingFields::INTERESTS => array(
array(
'id' => 6003020834693,
'name' => 'Music',
),
),
TargetingFields::LIFE_EVENTS => array(
array(
'id' => 6002714398172,
'name' => 'Newlywed (1 year)',
),
),
),
),
TargetingFields::EXCLUSIONS => array(
TargetingFields::RELATIONSHIP_STATUSES => array(1, 3),
TargetingFields::LIFE_EVENTS => array(
array(
'id' => 6003054185372,
'name' => 'Recently moved',
),
),
),
)),
));
$adset->create(array(
AdSet::STATUS_PARAM_NAME => AdSet::STATUS_ACTIVE,
));
from facebookads.adobjects.adset import AdSet
adset = AdSet(parent_id='act_<AD_ACCOUNT_ID>')
adset.update({
AdSet.Field.name: 'My AdSet',
AdSet.Field.optimization_goal: AdSet.OptimizationGoal.reach,
AdSet.Field.billing_event: AdSet.BillingEvent.impressions,
AdSet.Field.bid_amount: 150,
AdSet.Field.daily_budget: 2000,
AdSet.Field.campaign_id: <CAMPAIGN_ID>,
AdSet.Field.targeting: {
'geo_locations': {
'countries': ['US'],
},
'age_min': 18,
'age_max': 43,
'flexible_spec': [
{
'behaviors': [
{
'id': 6002714895372,
'name': 'All 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)',
},
],
},
],
'exclusions': {
'relationship_statuses': [1, 3],
'life_events': [
{
'id': 6003054185372,
'name': 'Recently moved',
},
],
},
},
})
adset.remote_create(params={
'status': AdSet.Status.active,
})
AdSet adSet = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAdSet()
.setName("My AdSet")
.setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH)
.setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS)
.setBidAmount(150L)
.setDailyBudget(2000L)
.setCampaignId(<CAMPAIGN_ID>)
.setTargeting(
new Targeting()
.setFieldAgeMax(43L)
.setFieldAgeMin(18L)
.setFieldExclusions(
new FlexibleTargeting()
.setFieldLifeEvents(Arrays.asList(
new IDName()
.setFieldId("6003054185372")
.setFieldName("Recently moved")
))
.setFieldRelationshipStatuses(Arrays.asList(1L, 3L))
)
.setFieldFlexibleSpec(Arrays.asList(
new FlexibleTargeting()
.setFieldBehaviors(Arrays.asList(
new IDName()
.setFieldId("6002714895372")
.setFieldName("All travelers")
))
.setFieldInterests(Arrays.asList(
new IDName()
.setFieldId("6003107902433")
.setFieldName("Association football (Soccer)")
,
new IDName()
.setFieldId("6003139266461")
.setFieldName("Movies")
))
,
new FlexibleTargeting()
.setFieldInterests(Arrays.asList(
new IDName()
.setFieldId("6003020834693")
.setFieldName("Music")
))
.setFieldLifeEvents(Arrays.asList(
new IDName()
.setFieldId("6002714398172")
.setFieldName("Newlywed (1 year)")
))
))
.setFieldGeoLocations(
new TargetingGeoLocation()
.setFieldCountries(Arrays.asList("US"))
)
)
.setStatus(AdSet.EnumStatus.VALUE_ACTIVE)
.execute();
String ad_set_id = adSet.getId();
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":"All 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
이 유연한 사양을 사용한 결과로 얻은 타겟은 다음과 같습니다.
(세그먼트 1 or
세그먼트 2 or
세그먼트 3) 및 (세그먼트 4 or
세그먼트 5) 및 세그먼트 6
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':'All 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": "All travelers" } ] }, { "interests": [ { "id": "6003020834693", "name": "Music" } ], "life_events": [ { "id": "6002714398172", "name": "Newlywed (1 year)" } ] } ], "geo_locations": { "countries": [ "US" ] } }, "id": "6015417075447" }