When you find a certain targeting combination that works well for your ads, you may like to make a lookalike audience on top of it for using in targeting for other campaigns. In the past, you can create lookalike audiences based on your own custom audience, users tracked by certain conversion pixels, or users who like your Page.
Now, Facebook has introduced a new kind of lookalike: campaign/ad set conversion lookalike. You can create a lookalike audience based on the converters in ad campaigns and/or ad sets.
With the new campaign/ad set conversion lookalike audience, you can use the converters of your current campaign/ad set to improve itself by using it as the seed of your current campaign/ad set. As Facebook will keep updating the underlying prediction model as these campaigns or ad sets get newer converters, the lookalike audience expands itself during the process. The flow is now changed to conversions →lookalike audiences →more conversions→more lookalike audiences, a self-improving loop.
To create a campaign using dynamic targeting, you should do these:
The following example codes using Facebook PHP Ads API SDK or Python Ads API SDK do exactly this job, assuming the pilot ad set has collection a reasonable amount of converters already:
use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\LookalikeAudience;
use FacebookAds\Object\Fields\LookalikeAudienceFields;
// Step 1, create a campaign. Assuming done already.
$campaign_id = <CAMPAIGN_GROUP_ID>;
// Step 2, create a pilot ad set and run it. Assuming that this is done,
// and this adset has at least 100, ideally over 200 convertors
$pilot_adset_id = <PILOT_ADSET_ID>;
$adaccount_id = 'act_<AD_ACCOUNT_ID>';
// Step 3, create a second ad set with the remaining main part of your budget.
$data = array(
AdSetFields::NAME => 'My AdSet',
AdSetFields::BID_TYPE => 'CPA',
AdSetFields::BID_INFO => array(
'ACTIONS' => 500,
),
AdSetFields::PROMOTED_OBJECT => array(
'page_id' => <PAGE_ID>,
),
AdSetFields::CAMPAIGN_STATUS => AdSet::STATUS_PAUSED,
AdSetFields::DAILY_BUDGET => 20000,
AdSetFields::CAMPAIGN_GROUP_ID => $campaign_id,
AdSetFields::TARGETING => array(
'geo_locations' => array(
'countries' => array(
'US',
),
),
),
);
$ad_set = new AdSet(null, $adaccount_id);
$ad_set->create($data);
$adset_id = $ad_set->id;
// Step 4, create a campaign/ad set conversion lookalike audience, using
// both those two ad sets.
$lookalike = new LookalikeAudience(null, $adaccount_id);
$lookalike->{LookalikeAudienceFields::LOOKALIKE_SPEC} = array(
'origin_ids' => array($pilot_adset_id, $adset_id),
'ratio' => 0.05,
'conversion_type' => 'campaign_conversions',
'country' => 'US',
);
$lookalike->create();
$lookalike_id = $lookalike->id;
//Step 5, update the second ad set's targeting with this lookalike audience.
$ad_set->campaign_status = AdSet::STATUS_ACTIVE;
$ad_set->targeting = array(
'geo_locations' => array(
'countries' => array(
'US',
),
),
'custom_audiences' => array(
array(
'id' => $lookalike_id,
)
),
),
$ad_set->update();