Within dynamic ads, you have the option to use dynamic formats and ad creative. This feature displays different formats and ad creative to different people, based on what they are most likely to respond to.
Currently, the available formats are collection ads and carousel ads. Both formats have different creative variation options. We make format and creative choices based on what is most likely to resonate with each person seeing your ad. We pick a format for each ad impression, whether to show a description, and which description to display, if shown.
To use dynamic formats and creative, we recommend these steps:
When you provide your campaign's creative, you can let us know you want to use dynamic formats and creative. You do that by specifying FORMAT_AUTOMATION
as an optimization_type
inside your asset_feed_spec
. Your API call must contain the following fields:
product_set_id
Provide the ID of the product set to be used. A product set is a group of related items in a product catalog that you advertise in dynamic ads.
template_data
For dynamic ads, you can add template parameters for your ad creative. Those parameters properly render at run-time based on data in your product feed. Inside object_story_spec
, the template_data
object allows you to build your template.
For dynamic formats and ad creative, template_data
has the following required fields:
Field | Description |
---|---|
| Whether an advertiser wants to use the end card in the Carousel ad format. Set to |
| Optional. One template tag to be used as the product's name. See supported template tags. |
| Link for the offsite landing page. A user will be directed to this link if they click your Call To Action button. |
| Optional. Copy for your ad. |
| A call to action for the user seeing your ad. Use any call to action type compatible with dynamic ads. |
asset_feed_spec
An asset feed is a collection of different creative elements, such as image, titles, bodies, and so on. The asset_feed_spec
gives you the specifications for an asset feed.
For dynamic formats and ad creative, asset_feed_spec
can include:
Field | Description |
---|---|
| Required. Type of optimization being used. Set to |
| Required. List of ad formats. Set to |
| Optional. Specify one description option. The text is used for ads served in the Carousel format. You can use supported template tags or a free-form message. |
| Optional. Use this field to set a custom image as cover media for a collection ad. See example of API call using this field. |
| Optional. Use this field to set a custom video as cover media for a collection ad. See example of API call using this field. |
The following is an example of dynamic formats and creative. In this case, the cover media for collection ads defaults to a dynamically generated video:
curl \ -F 'name=Dynamic Formats and Creative Test' \ -F 'adset_id=<AD_SET_ID>' \ -F 'creative={ "name": "Creative for Dynamic Formats and Creative Test", "product_set_id": "<PRODUCT_SET_ID>", "object_type": "SHARE", "object_story_spec": { "page_id": "<PAGE_ID>", "template_data": { "multi_share_end_card": "true", "name": "{{product.name}}", "link": "<OFFSITE_LANDING_PAGE>", "message": "<AD_COPY>", "call_to_action": {"type": "SHOP_NOW"}, }}, "asset_feed_spec":{ "optimization_type":"FORMAT_AUTOMATION", "ad_formats": ["CAROUSEL", "COLLECTION"]}, "descriptions": [{"text": "{{product.brand}}", "From {{product.current_price}}", ...]} }' \ -F 'url_tags=<URL_TAGS>' \ -F 'tracking_specs=[{"action.type":"offsite_conversion","fb_pixel":<PIXEL_ID>}]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v<API_VERSION>/act_<AD_ACCOUNT>/ads
The following is an example of dynamic formats and creative. In this case, the cover media for collection ads is set to a custom image:
curl \ -F 'name=Dynamic Formats and Creative Test - Custom Image' \ -F 'adset_id=<AD_SET_ID>' \ -F 'creative={ "name": "Creative For Dynamic Formats and Creative Test - Custom Image", "product_set_id": "<PRODUCT_SET_ID>", "object_type": "SHARE", "object_story_spec": { "page_id": "<PAGE_ID>", "template_data": { "multi_share_end_card": "true", "name": "{{product.name}}", "link": "<OFFSITE_LANDING_PAGE>", "message": "<AD_COPY>", "call_to_action": {"type": "SHOP_NOW"}, } }, "asset_feed_spec":{ "optimization_type":"FORMAT_AUTOMATION", "ad_formats": ["CAROUSEL", "COLLECTION"], "images": [{"hash": "<customized_image_hash>"}], "descriptions": [{"text": "{{product.description}}", "From {{product.current_price}}", ...] } }' \ -F 'url_tags=<URL_TAGS>' \ -F 'tracking_specs=[{"action.type":"offsite_conversion","fb_pixel":<PIXEL_ID>}]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v<API_VERSION>/act_<AD_ACCOUNT>/ads
The following is an example of dynamic formats and creative. In this case, the cover media for collection ads is set to a custom video:
curl \ -F 'name=Dynamic Formats and Creative Test - Custom Video' \ -F 'adset_id=<AD_SET_ID>' \ -F 'creative={ "name": "Creative For Dynamic Formats and Creative Test - Custom Video", "product_set_id": "<PRODUCT_SET_ID>", "object_type": "SHARE", "object_story_spec": { "page_id": "<PAGE_ID>", "template_data": { "multi_share_end_card": "true", "link": "<LINK>", "message": "<AD_COPY>", "call_to_action": {"type": "SHOP_NOW"}, } }, "asset_feed_spec":{ "optimization_type":"FORMAT_AUTOMATION", "ad_formats": ["CAROUSEL", "COLLECTION"], "videos": [{"video_id": "<VIDEO_ID>"}]}, "descriptions": [{"text": "{{product.description}}", "From {{product.current_price}}", ...]} }' \ -F 'tracking_specs=[{"action.type":"offsite_conversion","fb_pixel":<PIXEL_ID>}]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v<API_VERSION>/act_<AD_ACCOUNT>/ads
The collection format features 4 products under a hero image or video that opens into a fullscreen Instant Experience. The hero image or video is also called cover media. The dynamic formats and creative API calls are different, depending on your choice for cover media.
The standard behavior is to add a dynamically generated video as your ad's cover media. In this case, we automatically generate a personalized video for each user that sees your ad. The video highlights products from the catalog that are most relevant to the user. Alternatively, you can provide your own custom image or video for the cover media position.
Help Center: About Collection AdsThe carousel format lets you show two or more images and videos, descriptions and links or calls to action in a single ad. For dynamic formats and creative, you can select possible description variations.
Specify your description variations under the field in the API call: descriptions
under asset_feed_spec
. Add all your description options under descriptions
, and list the first one under description
.
Your description options can contain catalog information or new free-form short message, like "Free Shipping".
To use information available on your catalog, you can use the following template tags:
{{product.price}}
{{product.current_price}}
{{product.description}}
{{product.short_description}}
{{product.brand}}
{{product.name}}
The following tags cannot be used at the same time:
{{product.price}}
and {{product.current_price}}
{{product.description}}
and {{product.short_description}}
Be mindful of the following:
Format | Creative Variations |
---|---|
Collection Ads | Cover media can be:
You must pick one option. |
Carousel Ads | Description can be:
Both can be used at the same time. |