News for Developers

Back to News

Advanced Lookalikes Creation

Rituparna Mukherjee
November 23, 2015

Related News

Brand Awareness

September 15 2016

On Nov 11, we released the new advanced options to create lookalike audiences. When you create Lookalike Audiences, audience overlap is a common problem which advertisers have been experiencing. Since a user can see an ad only two times in a day, this audience overlap results in wasted delivery opportunities. Advertisers have been experimenting with exclusion targeting as a workaround to solve the problem of overlapping segmentation. The advanced options also addresses this by allowing a user to create mutually exclusive lookalike segments.

For advertisers who measure revenue per conversion or lifetime value for people in different audiences, the advanced option can be used to segment lookalikes based on degree of similarity to the source. This allows advertisers to bid differently for audiences with different conversion values.

The advanced options for creating lookalikes help advertisers prospect new customers or transactions efficiently by making it easier to bid differently for audiences with different conversion values. In general, lookalike audiences, which are more similar to the source audience, are more valuable. But this varies based on quality of the source audience and nature of the target audience.

However, utilizing the full potential of this capability is a four-step process. Consider the following scenario-

  • An eComm advertiser has a custom audience of high value customers. She uses the advanced options to create three non-overlapping lookalikes: the “most similar” audience, the “second most similar” audience, and the “least similar” audience.
  • Then she creates three ad sets and places initial bids and starts a campaign.
  • While the campaign runs, she observes that the conversions from the “most similar” audience are worth $100, the conversions from the “second most similar” audience are worth $10, and the conversions from the “least similar” audience are worth $1.
  • She can then adjust her bids accordingly leaning towards the most valuable customer segment.

Let us see how to use our API to iterate through the above steps:

Step 1: Create separate lookalikes with different ranges using the advanced options

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypes;

$lookalike = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$lookalike->setData(array(
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypes::LOOKALIKE,
  CustomAudienceFields::LOOKALIKE_SPEC => array(
    'origin_ids' => <CAMPAIGN_ID>,
    'starting_ratio' => 0.03,
    'ratio' => 0.05,
    'conversion_type' => 'campaign_conversions',
    'country' => 'US',
  ),
));
$lookalike->create();
from facebookads.adobjects.customaudience import CustomAudience

lookalike = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
lookalike.update({
    CustomAudience.Field.subtype: CustomAudience.Subtype.lookalike,
    CustomAudience.Field.lookalike_spec: {
        'origin_ids': '<CAMPAIGN_ID>',
        'starting_ratio': 0.03,
        'ratio': 0.05,
        'conversion_type': 'campaign_conversions',
        'country': 'US',
    },
})

lookalike.remote_create()
print(lookalike)
curl \
  -F 'subtype=LOOKALIKE' \
  -F 'lookalike_spec={ 
    "origin_ids": "<CAMPAIGN_ID>", 
    "starting_ratio": 0.03, 
    "ratio": 0.05, 
    "conversion_type": "campaign_conversions", 
    "country": "US" 
  }' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

The starting_ratio field is the starting percentage and the ratio field is the maximum percentage using which the lookalike segment is created. This api call will create a lookalike audience based off the 3% to 5% tier of the audience who converted in the running campaign. We can use the same api call with starting_ratio as 0.01 and ratio as 0.03 to create a lookalike from 1% to 3% segment. So now we have two lookalikes.

Step 2: Run the same ads for different lookalike audiences with initial bids

We first create adsets using the lookalike audince IDs from step 1.

use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Values\BillingEvents;
use FacebookAds\Object\Values\OptimizationGoals;
use FacebookAds\Object\Fields\TargetingSpecsFields;
use FacebookAds\Object\TargetingSpecs;

$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
AdSetFields::NAME => 'My AdSet',
AdSetFields::OPTIMIZATION_GOAL => OptimizationGoals::IMPRESSIONS,
AdSetFields::BILLING_EVENT => BillingEvents::LINK_CLICKS,
AdSetFields::BID_AMOUNT => 100,
AdSetFields::DAILY_BUDGET => 2000,
AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
AdSetFields::TARGETING => (new TargetingSpecs())->setData(array(
TargetingSpecsFields::GEO_LOCATIONS => array(
'countries' => array('US'),
),
TargetingSpecsFields::CUSTOM_AUDIENCES => array(
array(
'id' => <LOOKALIKE_AUDIENCE_ID>,
),
),
)),
));

$adset->create(array(
AdSet::STATUS_PARAM_NAME => AdSet::STATUS_ACTIVE,
));
from facebookads.objects import AdSet

adset = AdSet(parent_id='act_<AD_ACCOUNT_ID>')
targeting_spec = {
TargetingSpecsField.geo_locations: {
'countries': ['US'],
},
TargetingSpecsField.custom_audiences: [{
'id': <LOOKALIKE_AUDIENCE_ID>,
}],
}

adset[AdSet.Field.name] = 'My Adset'
adset[AdSet.Field.optimization_goal] = AdSet.OptimizationGoal.impressions
adset[AdSet.Field.billing_event] = AdSet.BillingEvent.link_clicks
adset[AdSet.Field.bid_amount] = 100
adset[AdSet.Field.daily_budget] = 2000
adset[AdSet.Field.campaign_id] = <CAMPAIGN_ID>
adset[Adset.Field.targeting] = targeting_spec,

params = {'status': AdSet.Status.paused}
adset.remote_create(params=params)
curl \
-F 'name=My AdSet' \
-F 'optimization_goal=IMPRESSIONS' \
-F 'billing_event=LINK_CLICKS' \
-F 'bid_amount=100' \
-F 'daily_budget=2000' \
-F 'campaign_id=<CAMPAIGN_ID>' \
-F 'targeting={ 
"geo_locations": {"countries":["US"]}, 
"custom_audiences": [{"id":"<LOOKALIKE_AUDIENCE_ID>"}] 
}' \
-F 'status=ACTIVE' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.5/act_<AD_ACCOUNT_ID>/adsets

The above call should be made once for each lookalike audience, since we have two audience, we make it twice. Once we have the two adset IDs, we use these to create similar ads for both the adsets.

use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;

$data = array(
  AdFields::NAME => 'My Ad',
  AdFields::ADSET_ID => <AD_SET_ID>,
  AdFields::CREATIVE => array(
    'creative_id' => <CREATIVE_ID>,
  ),
);

$ad = new Ad(null, 'act_<AD_ACCOUNT_ID>');
$ad->setData($data);
$ad->create(array(
  Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED,
));
from facebookads.adobjects.ad import Ad

ad = Ad(parent_id='act_<AD_ACCOUNT_ID>')
ad[Ad.Field.name] = 'My Ad'
ad[Ad.Field.adset_id] = <AD_SET_ID>
ad[Ad.Field.creative] = {
    'creative_id': <CREATIVE_ID>,
}
ad.remote_create(params={
    'status': Ad.Status.paused,
})
Ad ad = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAd()
  .setName("My Ad")
  .setAdsetId(<AD_SET_ID>)
  .setCreative(
    new AdCreative()
      .setFieldId(<CREATIVE_ID>)
  )
  .setStatus(Ad.EnumStatus.VALUE_PAUSED)
  .execute();
ad_account = FacebookAds::AdAccount.get('act_<AD_ACCOUNT_ID>')
ad = ad_account.ads.create({
  name: 'My Ad',
  adset_id: <ADSET_ID>,
  creative: {
    creative_id: <CREATIVE_ID>,
  },
  status: 'PAUSED',
})
curl \
  -F 'name=My Ad' \
  -F 'adset_id=<AD_SET_ID>' \
  -F 'creative={"creative_id":"<CREATIVE_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads

Validate the set up and once confirmed, change their status to active.

Step 3: Observe revenue per conversion or lifetime value for people in each audience

Let's say, that on observing revenues from these ads, we see higher revenue for the 1% to 3% lookalike segment. We then move to the next step.

Step 4: Step 4: Modify the bids for each segment based on the revenue

Here you bid more for more valuable audiences and less for less valuable audiences:

use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Values\AdSetBillingEventValues;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;

$adset = new AdSet(<AD_SET_ID>, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
  AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
  AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::LINK_CLICKS,
  AdSetFields::BID_AMOUNT => 200,
));

$adset->update();
from facebookads.adobjects.adset import AdSet

adset = AdSet(fbid=<AD_SET_ID>, parent_id='act_<AD_ACCOUNT_ID>')
adset.update({
    AdSet.Field.optimization_goal: AdSet.OptimizationGoal.link_clicks,
    AdSet.Field.billing_event: AdSet.BillingEvent.impressions,
    AdSet.Field.bid_amount: 200,
})
adset.remote_update()
new AdSet(<AD_SET_ID>, context).update()
  .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS)
  .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS)
  .setBidAmount(200L)
  .execute();
curl \
  -F 'billing_event=IMPRESSIONS' \
  -F 'optimization_goal=LINK_CLICKS' \
  -F 'bid_amount=200' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<AD_SET_ID>

The adset ID should belong to the second adset which was created for the 1% to 3% lookalike segment.

Now we have the bids adjusted based on the value of each lookalike segment.

For more details on using the advanced options, please visit our Help Center. More on lookalike audience can be found at our Marketing API docs.


Related News

September 15 2016

December 18 2015

December 16 2015

December 09 2015

December 07 2015

November 11 2015