Back to News for Developers

Video for Website Clicks

June 9, 2015ByChristine Lu

In an effort to help advertisers meet their objectives across all creative formats, we're now offering video as a creative option when running link ads to drive clicks to your website. Earlier this year we added video creative to three (3) objectives: Page Likes, Local Awareness, and Website Conversions.

With this update, we're letting you pair the power of video with website clicks optimization to help you achieve your direct response advertising goals. We believe video will continue to be an important component of campaigns moving customers through the purchase funnel.

Link ads with video capabilities include a call-to-action button during and post-video play that drive people offsite to a website to increase website traffic and possibly convert on site.

Here are the steps to create a video Website Clicks ad:

1. Create the campaign with WEBSITE_CLICKS as the objective

use FacebookAds\Object\AdCampaign;
use FacebookAds\Object\Fields\AdCampaignFields;

$campaign = new AdCampaign(null, 'act_<AD_ACCOUNT_ID>');
$campaign->setData(array(
AdCampaignFields::NAME => 'my campaign group',
AdCampaignFields::STATUS => AdCampaign::STATUS_PAUSED,
AdCampaignFields::OBJECTIVE => AdObjectives::WEBSITE_CLICKS,
));

$campaign->create();
from facebookads.objects import AdCampaign

campaign = AdCampaign(parent_id='act_<AD_ACCOUNT_ID>')

campaign[AdCampaign.Field.name] = 'my campaign group'
campaign[AdCampaign.Field.status] = AdCampaign.Status.paused
campaign[AdCampaign.Field.objective] = AdCampaign.Objective.website_clicks

campaign.remote_create()
curl \
-F "name=my campaign" \
-F "campaign_group_status=PAUSED" \
-F "objective=WEBSITE_CLICKS" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcampaign_groups

2. Create the ad set. It is recommended to bid oCPM for actions, which in the case of Website Clicks actions will be defined as link clicks.

use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Values\BidTypes;

$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
AdSetFields::NAME => 'DailyBudgetSet',
AdSetFields::DAILY_BUDGET => 1000,
AdSetFields::BID_TYPE => BidTypes::BID_TYPE_ABSOLUTE_OCPM,
AdSetFields::BID_INFO => array(
'ACTIONS' => 150,
),
AdSetFields::TARGETING => array(
'geo_locations' => array(
'countries' => array('US'),
),
),
AdSetFields::CAMPAIGN_STATUS => AdSet::STATUS_ACTIVE,
AdSetFields::CAMPAIGN_GROUP_ID => <CAMPAIGN_ID>,
));

$adset->create();
from facebookads.objects import AdSet

adset = AdSet(parent_id='act_<AD_ACCOUNT_ID>')
adset[AdSet.Field.name] = 'DailyBudgetSet'
adset[AdSet.Field.daily_budget] = 1000
adset[AdSet.Field.bid_type] = AdSet.BidType.absolute_ocpm
adset[AdSet.Field.bid_info] = {
'ACTIONS': 150,
}
adset[AdSet.Field.targeting] = {
'geo_locations': {
'countries': ['US'],
},
}
adset[AdSet.Field.status] = AdSet.Status.active
adset[AdSet.Field.campaign_group_id] = <CAMPAIGN_ID>

adset.remote_create()
curl \
-F "name=DailyBudgetSet" \
-F "daily_budget=1000" \
-F "bid_type=ABSOLUTE_OCPM" \
-F "bid_info={'ACTIONS':150}" \
-F "targeting={'geo_locations': {'countries': ['US']}}" \
-F "campaign_status=ACTIVE" \
-F "campaign_group_id=<CAMPAIGN_ID>" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/act_<AD_ACCOUNT_ID>/adcampaigns

3. Create your ad creative, the example below uses the ad creative's object_story_spec field for video_data, with a link.

use FacebookAds\Object\AdCreative;
use FacebookAds\Object\ObjectStory\VideoData;
use FacebookAds\Object\Fields\ObjectStory\VideoDataFields;
use FacebookAds\Object\ObjectStorySpec;
use FacebookAds\Object\Fields\ObjectStorySpecFields;
use FacebookAds\Object\Fields\AdCreativeFields;

$video_data = new VideoData();
$video_data->setData(array(
VideoDataFields::DESCRIPTION => 'New apple pies for the season',
VideoDataFields::IMAGE_URL => '<IMAGE_URL>',
VideoDataFields::VIDEO_ID => '<VIDEO_ID>',
VideoDataFields::CALL_TO_ACTION => array(
'type' => 'SHOP_NOW',
'value' => array(
'link' => '<LINK>',
)
),
));

$object_story_spec = new ObjectStorySpec();
$object_story_spec->setData(array(
ObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
ObjectStorySpecFields::VIDEO_DATA => $video_data,
));

$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');

$creative->setData(array(
AdCreativeFields::NAME => 'AdCreative for Website Clicks Ad',
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
));

$creative->create();
from facebookads.objects import AdCreative
from facebookads.specs import ObjectStorySpec, VideoData

video_data = VideoData()
video_data[VideoData.Field.description] = 'New apple pies for the season'
video_data[VideoData.Field.video_id] = '<VIDEO_ID>'
video_data[VideoData.Field.image_url] = '<IMAGE_URL>'

call_to_action = {
'type': 'SHOP_NOW',
'value': {
'link': '<LINK>',
}
}

video_data[VideoData.Field.call_to_action] = call_to_action

object_story_spec = ObjectStorySpec()
object_story_spec[ObjectStorySpec.Field.page_id] = <PAGE_ID>
object_story_spec[ObjectStorySpec.Field.video_data] = video_data

creative = AdCreative(parent_id='act_<AD_ACCOUNT_ID>')
creative[AdCreative.Field.name] = 'AdCreative for Website Clicks Ad'
creative[AdCreative.Field.object_story_spec] = object_story_spec
creative.remote_create()
curl \
-F 'name=AdCreative for Website Clicks Ad' \
-F 'object_story_spec={"page_id":<PAGE_ID>, "video_data":{"call_to_action":{"type":"SHOP_NOW", value:{"link":"<LINK>"}}, "video_id":"<VIDEO_ID>", "image_url":"<IMAGE_URL>", "description":"New apple pies for the season"}}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/act_<AD_ACCOUNT_ID>/adcreatives

4. Assign the creative to an ad

use FacebookAds\Object\AdGroup;
use FacebookAds\Object\Fields\AdGroupFields;

$ad = new AdGroup(null, 'act_<AD_ACCOUNT_ID>');
$ad->setData(array(
AdGroupFields::NAME => 'sample page post ad',
AdGroupFields::CAMPAIGN_ID => <AD_SET_ID>,
AdGroupFields::CREATIVE => array(
'creative_id' => <CREATIVE_ID>,
),
));

$ad->create();
from facebookads.objects import AdGroup

ad = AdGroup(parent_id='act_<AD_ACCOUNT_ID>')
ad[AdGroup.Field.name] = 'sample page post ad'
ad[AdGroup.Field.campaign_id] = <AD_SET_ID>
ad[AdGroup.Field.creative] = {'creative_id': '<CREATIVE_ID>'}

adgroup.remote_create()
curl \
-F "campaign_id=<AD_SET_ID>" \
-F "name=sample page post ad" \
-F "creative={'creative_id':<CREATIVE_ID>}" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adgroups

Learn more about video ads here.


Tags: