Last year, we introduced carousel ads which allowed advertisers to showcase multiple static images within a single ad unit. The carousel format is a popular ad format that provides advertisers with more creative real-estate in News Feed.
With the latest update, we are adding the video creative to the carousel unit, giving advertisers the creative flexibility to leverage the most engaging and powerful format we have in feed. Adding video as a creative option can bring sight, sound, and motion to help advertisers improve both their Brand and DR objectives.
Advertisers can use video as a creative option in any slot of the carousel unit to pull people into the unit and will be available for Mobile App Install
, Mobile App Engagement
, Website Clicks
, Website Conversions
, and Page Post Engagement
objectives. Developers can simply provide the video id of a previously uploaded video in the video_id
field within the child_attachments
in any order to add videos along side photo-only children.
Here is an example of carousel ads using video creatives. Note that when video_id
is used, image_hash
or picture
must also be specified.
use FacebookAds\Object\AdCreative;
use FacebookAds\Object\Fields\AdCreativeFields;
use FacebookAds\Object\Fields\ObjectStory\LinkDataFields;
use FacebookAds\Object\Fields\ObjectStorySpecFields;
use FacebookAds\Object\Fields\ObjectStory\AttachmentDataFields;
use FacebookAds\Object\ObjectStory\AttachmentData;
use FacebookAds\Object\ObjectStory\LinkData;
use FacebookAds\Object\ObjectStorySpec;
$product1 = new AttachmentData();
$product1->setData(array(
AttachmentDataFields::LINK => '<PRODUCT_1_URL>',
AttachmentDataFields::NAME => 'Product 1',
AttachmentDataFields::DESCRIPTION => '$8.99',
AttachmentDataFields::IMAGE_HASH => '<IMAGE_1_HASH>',
AttachmentDataFields::VIDEO_ID => '<VIDEO_1_ID>',
));
$product2 = new AttachmentData();
$product2->setData(array(
AttachmentDataFields::LINK => '<PRODUCT_2_URL>',
AttachmentDataFields::NAME => 'Product 2',
AttachmentDataFields::DESCRIPTION => '$9.99',
AttachmentDataFields::IMAGE_HASH => '<IMAGE_2_HASH>',
AttachmentDataFields::VIDEO_ID => '<VIDEO_2_ID>',
));
$product3 = new AttachmentData();
$product3->setData(array(
AttachmentDataFields::LINK => '<PRODUCT_3_URL>',
AttachmentDataFields::NAME => 'Product 3',
AttachmentDataFields::DESCRIPTION => '$10.99',
AttachmentDataFields::IMAGE_HASH => '<IMAGE_3_HASH>',
));
$product4 = new AttachmentData();
$product4->setData(array(
AttachmentDataFields::LINK => '<PRODUCT_4_URL>',
AttachmentDataFields::NAME => 'Product 4',
AttachmentDataFields::DESCRIPTION => '$11.99',
AttachmentDataFields::IMAGE_HASH => '<IMAGE_4_HASH>',
));
$link_data = new LinkData();
$link_data->setData(array(
LinkDataFields::LINK => '<URL>',
LinkDataFields::CAPTION => 'My caption',
LinkDataFields::CHILD_ATTACHMENTS => array($product1, $product2, $product3, $product4),
));
$object_story_spec = new ObjectStorySpec();
$object_story_spec->setData(array(
ObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
ObjectStorySpecFields::LINK_DATA => $link_data,
));
$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');
$creative->setData(array(
AdCreativeFields::NAME => 'Sample Creative',
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
));
$creative->create();
For more details on the API, refer to the Carousel Ads and Ad Video reference documents.
TAGS
Sign up for monthly updates from Meta for Developers.