Dynamic Ads for Automotive

Enables you to create Dynamics Ads which advertise cars, trucks and other types of vehicles.

To use this feature:

For more information and background see Frequently Asked Questions.

Step 1: Create Vehicle Catalog

To create a catalog, you should connect a data feed or upload data to Facebook. The data should contain all the required fields for the vehicles that you want advertise, which are listed below. For background, see Dynamic Ads, Product Catalog.

For example:

curl \
-F 'name=catalog name' \
-F 'access_token=<ACCESS TOKEN>' \
-F 'vertical=vehicles' \
https://graph.facebook.com/<VERSION>/<BUSINESS ID>/product_catalogs

Create Data Feed

Provide your feed in the correct format. Feed can be in CSV, TSV, or XML formats. Once you create the feed file, you should host it at a URL for regular scheduled updates.

For example, a TSV file with tab delimiters looks like this:

vehicle_id title description url make model year mileage.value mileage.unit image[0].url image[0].tag[0] transmission fuel_type body_style drivetrain vin condition price address exterior_color sale_price availability state_of_vehicle latitude longitude i2 2017 Ford Fusion SE Ford Certified and 6-Speed Automatic. Turbocharged! Gasoline! http://www.example.com/test Ford Fusion 2017 1500 KM http://www.facebook.com/teapic.jpg Gym AUTOMATIC GASOLINE SEDAN FWD 1FADP5AU6DL536022 EXCELLENT 18000 USD {addr1: '550 Auto Center Dr', city: 'Watsonville', region: 'CA', postal_code: '96075', country: 'US'} white 16000 USD AVAILABLE NEW 52.35 42.10

Here is an example feed, with images as an array:

auto_listing_id title description url make model year mileage.value mileage.unit image transmission fuel_type body_style drivetrain vin condition price address exterior_color sale_price availability state_of_vehicle latitude longitude
"i2" 2017 Ford Fusion SE Ford Certified and 6-Speed Automatic. Turbocharged! Gasoline! http://www.example.com/test Ford Fusion 2017 1500 KM "[{""url"":""https://images.trvl-media.com/hotels/3000000/2260000/2250400/2250336/2250336_1_y.jpg""}]" AUTOMATIC GASOLINE SEDAN FWD 1FADP5AU6DL536022 EXCELLENT 18000 USD {addr1: '550 Auto Center Dr', city: 'Watsonville', region: 'CA', postal_code: '96075', country: 'US'} white 16000 USD AVAILABLE NEW 52.35 42.10

This sample feed is as XML:

<?xml version="1.0" encoding="UTF-8"?>
<listings>
    <title>Vehicles Feed</title>
    <link rel="self" href="http://www.example.com"/>
    <listing>
      <vehicle_id>SED1234</vehicle_id>
      <title>2017 Ford Fusion SE</title>
      <description>Ford Certified and 6-Speed Automatic. Turbocharged! Gasoline!</description>
      <url>http://www.example.com/test</url>
      <make>Ford</make>
      <image>
        <url>http://example.com/some.image_1.jpg</url>
        <tag>Exterior</tag>
      </image>
      <model>Fusion</model>
      <year>2017</year>
      <mileage>
        <value>10</value>
        <unit>MI</unit>
      </mileage>
      <drivetrain>FWD</drivetrain>
      <vin>1FADP5AU6DL536022</vin>
      <body_style>SEDAN</body_style>
      <fuel_type>GASOLINE</fuel_type>
      <transmission>AUTOMATIC</transmission>
      <condition>EXCELLENT</condition>
      <price>18000 USD</price>
      <address format="simple">
          <component name="addr1">550 Auto Center Dr</component>
          <component name="city">Watsonville</component>
          <component name="region">CA</component>
          <component name="postal_code">95076</component>
          <component name="country">US</component>
      </address>
      <latitude>52.35</latitude>
      <longitude>42.10</longitude>
      <exterior_color>white</exterior_color>
      <sale_price>16000 USD</sale_price>
      <availability>AVAILABLE</availability>
      <state_of_vehicle>NEW</state_of_vehicle>
      <dealer_id>ABC1234</dealer_id>
    </listing>
</listings>

You can have a single vehicle feed to represent all vehicles in your catalog; or multiple vehicle feeds where each feed represents a single dealership or region's vehicles.

Filter vehicle catalog to vehicle sets

Reference Docs

A vehicle set is a subset of your catalog. To setup Dynamic Ads for Automotive, you need a vehicle set. Therefore, you have to create at least one.

Vehicle sets are defined by filters that are applied to the Vehicle catalog. For example, you can create a vehicle set with all vehicles with a `year later than 2015. Do note you can also create a vehicle set without any filters. In that case, the vehicle set will contain all vehicles in your catalog.

To create a vehicle set containing all the vehicles that is manufacture in 2016:

use FacebookAds\Object\ProductSet;
use FacebookAds\Object\Fields\ProductSetFields;

$vehicle_set = new ProductSet(null, <PRODUCT_CATALOG_ID>);

$vehicle_set->setData(array(
  ProductSetFields::NAME => 'Test Vehicle Set',
  ProductSetFields::FILTER => array(
    'year' => array(
      'eq' => 2016,
    ),
  ),
));

$ vehicle_set->create();

The filter parameter is made up of the following operators and data:

OperatorsThe type of filter

i_contains

Contains substring. Operator is case insensitive.

i_not_contains

Does not contain substring. Operator is case insensitive.

contains

Contains substring. Operator is case insensitive.

not_contains

Does not contain substring. Operator is case insensitive.

eq

Equal to. Operator is case insensitive.

neq

Not equal to. Operator is case insensitive.

lt

Less than. For numeric fields only.

lte

Less than or equal to. For numeric fields only.

gt

Greater than. For numeric fields only.

gte

Greater than or equal to. For numeric fields only.

Available vehicle fields for product set filtering

FieldDescription

make

Make or brand of the vehicle

model

Model of the vehicle

year

Year the vehicle was launched in

transmission

Transmission type of the vehicle.

body_style

Body style of the vehicle

fuel_type

Diesel, Electric, Gasoline, Flex, Hybrid, or Other

drivetrain

Drivetrain of the vehicle

price

Cost of vehicle and currency

state_of_vehicle

Whether the vehicle is new or used

exterior_color

Vehicle exterior color

address

A complete address for the dealership that must be resolvable to its location

Schedule Uploads

You should schedule feed uploads to automatically push the latest vehicle inventory data to Facebook instead of uploading refreshed files manually. To do this, make a POST request to product_feeds from the /{product_catalog_id}/product_feeds. To add a schedule to the feed, provide schedule in the POST request.

Step 2: Set up vehicles events on website

Dynamic Ads for Vehicles uses four events. Every event has a set of parameters

EventWhen to fire

Search

When the user searches for vehicles

ViewContent

When the user views a vehicle detail page

AddToWishlist

When the user saves, favorites or stars a vehicle

Lead

On the landing page after the user completes registration and submits a lead form

Facebook Pixel Setup

This is a small piece of JavaScript code in your web site for tracking the visitors' behavior and actions in the web site. When a visitor interacts with the web site, pixel events are fired in response to someone's actions. A pixel event is a very lightweight https request sent from the visitor's browser to Facebook's servers together with some extra information about that event, such as the page URL that someone views, product id or price of the product. To enable this tracking, you need to modify your web site and insert JavaScript code in certain pages.

Correctly setting up the pixel code is important for Dynamic Ads because our machine learning algorithm relies on the visitor-product interaction data in the web site collected from the pixel code. Without these data, Dynamic Ads would not be able to make good recommendations to the potential customers with high probability to convert.

Pixel Specifications

Field NameTypeRequiredExample

event_name

String

Yes

ViewContent, Lead, Search, AddToWishlist

content_type

String

Yes

vehicle

content_ids

array of strings

Yes

['123', 456]

user_zipcode

String

No

94025

make

String

No

Acura

make

String

No

Acura

model

String

No

MDX

year

int

No

2015

vin

String

No

KL9CD9S99EC111111

condition_of_vehicle

enum

No

new

exterior_color

String

No

black

transmission

enum

No

automatic

body_style

enum

No

sedan

fuel_type

enum

No

diesel

drivetrain

enum

No

AWD

price

float

No

2000

price_range

[float (min), float (max)]

No

Price range of the vehicle, such as [10000.99, 20000.99]

currency

String

No

Currency for the price. Specified using ISO 4217 currency format, such as USD

Make sure the pixel base code is already loaded when you fire an event. If you use a tag manager, make sure you include the tag that contains the pixel code on every page. The tag should appear before the tag that contains the pixel event code. Use the Facebook Pixel Helper to validate your pixel implementation.

ViewContent Pixel Event

    <script>
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
    n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
    document,'script','https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '<FB_PIXEL_ID>'); // pixel id
    fbq('track', "PageView");
    fbq('track', 'ViewContent', {
      content_type: 'vehicle', // REQUIRED: DO NOT change this, must be set to 'vehicle'
      content_ids: ['123'], // REQUIRED: array of vehicle IDs
      postal_code: '94025', // optional
      make: 'Lexus', // optional
      model: 'ES', // optional
      year: '2017', // optional
      vin: 'xxxxxxxxxxxx', // optional
      condition_of_vehicle: 'used', // optional
      exterior_color: 'black', // optional
      transmission: 'automatic', // optional
      body_style: 'sedan', // optional
      fuel_type: 'gasoline', // optional
      drivetrain: 'awd', // optional
      price: 1234.99, // up to 2 decimals optional
      currency: 'USD', // required if price and preferred_price_range is used 
      preferred_price_range: '[10000,20000]' //up to two decimals, min,max
});
</script>

If you are already using DPA (Dynamic Product Ads), send an additional event for DAA (Dynamic Ads for Automotive):

    <script>
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
    n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
    document,'script','https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '<FB_PIXEL_ID>'); // pixel id
    fbq('track', "PageView");
    // if using DPA
    fbq('track', 'ViewContent', {
      content_type: 'product',
      content_ids: ['1234'], 
    }); 

    fbq('track', 'ViewContent', {
      content_type: 'vehicle', // REQUIRED: DO NOT change this, must be set to 'vehicle'
      content_ids: ['123'], // REQUIRED: array of vehicle IDs
      postal_code: '94025', // optional
      make: 'Lexus', // optional
      model: 'ES', // optional
      year: '2017', // optional
      vin: 'xxxxxxxxxxxx', // optional
      condition_of_vehicle: 'used', // optional
      exterior_color: 'black', // optional
      transmission: 'automatic', // optional
      body_style: 'sedan', // optional
      fuel_type: 'gasoline', // optional
      drivetrain: 'awd', // optional
      price: 1234.99, // up to 2 decimals optional
      currency: 'USD', // required if price and preferred_price_range is used 
      preferred_price_range: '[10000,20000]' //up to two decimals, min,max
});
</script>

Step 3: Build Audience

Associate your pixel with your catalog via either Business Manager or API

Business Manager

  • Go to Business Manager | Product Catalogs | Settings | Associate Sources
  • Select your pixel

API

use FacebookAds\Object\ProductCatalog;

$product_catalog = new ProductCatalog(<PRODUCT_CATALOG_ID>);
$product_catalog->createExternalEventSource(array(), array(
  'external_event_sources' => array(
    <PIXEL_ID>
  ),
));

Then create event source group Facebook builds your audience based on events from these sources:

curl \
-F 'name=name of your event group' \
-F 'event_sources=["<PIXEL_ID>", "<APP_ID>"]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/<VERSION>/<BUSINESS_ID>/event_source_groups

Finally you can create and populate your audience like below:

Capture audience who have visited your vehicle pages belonging to a certain vehicle set, follow this example

curl \
-F 'name=Viewed vechicles in vehicle set in Last 30 days' \
-F 'subtype=CLAIM' \
-F 'claim_objective=VEHICLE' \
-F 'content_type=VEHICLE' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"vehicle_set_id":{"eq":"<VEHICLE_SET_ID>"}}' \
-F 'inclusions=[
{        
    "event": "ViewContent",
    "retention": {"min_seconds":0,"max_seconds":2592000}
},
{
    "event": "Search",
    "retention": {"min_seconds":0,"max_seconds":2592000}
},
{
    "event": "AddToWishlist",
    "retention": {"min_seconds":0,"max_seconds":2592000}
}
]' \
-F 'exclusions=[{
    "event":"Lead",
    "retention": {"min_seconds":0,"max_seconds":2592000}
}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.10/act_<AD_ACCOUNT_ID>/customaudiences

Step 4: Create and start dynamic ads for vehicles

This guide assumes you have a catalog and product set ready, and have set up the required vehicle events on your website or in your mobile app. You also need a Facebook Page and an ad account.

Targeting

Dynamic Ads for Auto currently supports retargeting. You can drive different business objectives by combining the right audience with the right product set:

Show relevant vehicles to people who have been to your website and/or app looking for vehicles. Expand the reach of your ad and find new customers by leveraging broad audiences.

Creating Ads

Creating Dynamic Ads for Auto follows the same process you follow when you set up any other type of Facebook ad with the API.

Step 1. Create Campaign

Dynamic Ads for Auto uses the PRODUCT_CATALOG_SALES objective. Specify a vehicle catalog in promoted_object at the campaign level:

use FacebookAds\Object\Campaign;
use FacebookAds\Object\Fields\CampaignFields;
use FacebookAds\Object\Values\CampaignObjectiveValues;

$campaign = new Campaign(null, 'act_<AD_ACCOUNT_ID>');
$campaign->setData(array(
  CampaignFields::NAME => 'Product Catalog Sales Campaign',
  CampaignFields::OBJECTIVE => CampaignObjectiveValues::PRODUCT_CATALOG_SALES,
  CampaignFields::PROMOTED_OBJECT => array(
    'product_catalog_id' => <PRODUCT_CATALOG_ID>,
  ),
));

$campaign->create(array(
  Campaign::STATUS_PARAM_NAME => Campaign::STATUS_PAUSED,
));
from facebookads.adobjects.campaign import Campaign

campaign = Campaign(parent_id='act_<AD_ACCOUNT_ID>')
campaign[Campaign.Field.name] = 'Product Catalog Sales Campaign'
objective = Campaign.Objective.product_catalog_sales
campaign[Campaign.Field.objective] = objective
campaign[Campaign.Field.promoted_object] = {
    'product_catalog_id': <PRODUCT_CATALOG_ID>,
}

campaign.remote_create(params={
    'status': Campaign.Status.paused,
})
Campaign campaign = new AdAccount(act_<AD_ACCOUNT_ID>, context).createCampaign()
  .setName("Product Catalog Sales Campaign Group")
  .setObjective(Campaign.EnumObjective.VALUE_PRODUCT_CATALOG_SALES)
  .setPromotedObject("{\"product_catalog_id\":\"" + <PRODUCT_CATALOG_ID> + "\"}")
  .setStatus(Campaign.EnumStatus.VALUE_PAUSED)
  .execute();
String campaign_id = campaign.getId();
curl \
  -F 'name=Product Catalog Sales Campaign' \
  -F 'objective=PRODUCT_CATALOG_SALES' \
  -F 'promoted_object={"product_catalog_id":"<PRODUCT_CATALOG_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/campaigns

Step 2. Create Ad Set

Once you have the campaign, and the campaign_id, you can create the ad set which defines the bidding and targeting options for your ads.

Retargeting

Retarget website visitors who have viewed vehicles in your defined product set

Creating the Ad Set

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

$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');

$adset->setData(array(
  AdSetFields::NAME => 'Product Catalog Sales Adset',
  AdSetFields::BID_AMOUNT => 3000,
  AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
  AdSetFields::OPTIMIZATION_GOAL =>
    AdSetOptimizationGoalValues::OFFSITE_CONVERSIONS,
  AdSetFields::DAILY_BUDGET => 15000,
  AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
  AdSetFields::TARGETING => array(
    TargetingFields::GEO_LOCATIONS => array(
      'countries' => array('US'),
    ),
    TargetingFields::DYNAMIC_AUDIENCE_IDS => array(<DYNAMIC_AUDIENCE_ID>),
  ),
  AdSetFields::PROMOTED_OBJECT => array(
    'product_set_id' => <PRODUCT_SET_ID>,
  ),
));

$adset->create(array(
  AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,
));
from facebookads.adobjects.adaccount import AdAccount
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.targeting import Targeting

ad_account = AdAccount(fbid=ad_account_id)

params = {
    AdSet.Field.name: 'Product Catalog Sales Adset',
    AdSet.Field.bid_amount: 3000,
    AdSet.Field.billing_event: AdSet.BillingEvent.impressions,
    AdSet.Field.optimization_goal: AdSet.OptimizationGoal.offsite_conversions,
    AdSet.Field.daily_budget: 15000,
    AdSet.Field.campaign_id: campaign_id,
    AdSet.Field.targeting: {
        Targeting.Field.geo_locations: {
            Targeting.Field.countries: ['US'],
        },
        Targeting.Field.dynamic_audience_ids: [
            dynamic_audience_id,
        ],
    },
    AdSet.Field.promoted_object: {
        'product_set_id': product_set_id,
    },
}
adset = ad_account.create_ad_set(params=params)
AdSet adSet = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAdSet()
  .setName("Product Catalog Sales Adset")
  .setBidAmount(3000L)
  .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS)
  .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS)
  .setDailyBudget(15000L)
  .setCampaignId(<CAMPAIGN_ID>)
  .setTargeting(
    new Targeting()
      .setFieldDynamicAudienceIds(Arrays.asList(<DYNAMIC_AUDIENCE_ID>))
      .setFieldGeoLocations(
        new TargetingGeoLocation()
          .setFieldCountries(Arrays.asList("US"))
      )
  )
  .setPromotedObject("{\"product_set_id\":\"" + <PRODUCT_SET_ID> + "\"}")
  .setStatus(AdSet.EnumStatus.VALUE_PAUSED)
  .execute();
String ad_set_id = adSet.getId();
curl \
  -F 'name=Product Catalog Sales Adset' \
  -F 'bid_amount=3000' \
  -F 'billing_event=IMPRESSIONS' \
  -F 'optimization_goal=OFFSITE_CONVERSIONS' \
  -F 'daily_budget=15000' \
  -F 'campaign_id=<CAMPAIGN_ID>' \
  -F 'targeting={ 
    "geo_locations": {"countries":["US"]}, 
    "dynamic_audience_ids": ["<DYNAMIC_AUDIENCE_ID>"] 
  }' \
  -F 'promoted_object={"product_set_id":"<PRODUCT_SET_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets

Unlike Dynamic Ads, Dynamic Ads for Auto does not support inline dynamic audience targeting specs in the Ad Set. You must separately create an audience first.

Step 3. Create Ad Creative

You can use template tags in your ad creatives for Dynamic Ads for Auto. When Facebook displays your ad, we replace template tags with actual vehicle choices. You can use template tags in the ad itself, as well as in the URL someone sees once they click on the ad.

Template Tags for Vehicle

Vehicle Feed schema

Type of FieldNameTypeDescription

Generic

vehicle_id

String, max 100

Unique ID for item. Can be a variant for a vehicle. If there are multiple instances of the same ID, we ignore all instances.

Generic

vin

String

VIN number of the vehicle

Generic

make

String

Make or brand of the vehicle, such as Ford

Generic

model

String

Model of the vehicle, such as Focus

Generic

year

int

Year the vehicle was launched in yyyy format, such as 2015

Generic

transmission

enum

Transmission type of the vehicle. Automatic or Manual

Generic

body_style

enum

Body style of the vehicle: CONVERTIBLE, COUPE, HATCHBACK, MINIVAN, TRUCK, SUV, SEDAN,VAN, WAGON, CROSSOVER, or OTHER.

Generic

fuel_type

enum

Diesel, Electric, Gasoline, Flex, Hybrid, or Other.

Generic

drivetrain

enum

Drivetrain of the vehicle. Expected values are: 4X2, 4X4, AWD, FWD, RWD, or Other.

Generic

description

String, max 5000

Short text describing the vehicle.

Vehicle Specific Details

image

object

Image data for this vehicle. You can provide up to 20 images for the vehicle. Each image contains two fields: url and tag. You can have multiple tags associated with an image. You must provide at least one image. Each image can be up to 4MB in size.

Vehicle Specific Details

image:url, subset of image object above

String

The URL of the vehicle image. If you want to use carousel ads, provide a square 1:1 aspect ratio images which are 600x600px. To show single vehicle ads provide images with 1.91:1 aspect ratio image at 1200x630px

Vehicle Specific Details

mileage.value

int

Mileage of the vehicle in kms or miles, for used vehicles. Zero for new vehicles.

Vehicle Specific Details

mileage.unit

String

Mileage units: MI or KM

Vehicle Specific Details

url

url

Link to the external site where you can view destination page.

Vehicle Specific Details

title

String

Title of vehicle, such as "2017 Ford Focus 5DR HD SE"

Vehicle Specific Details

price

String

Cost of vehicle and currency. Currency should follow ISO 4217 currency codes such as 13,999 USD.

Vehicle Specific Details

state_of_vehicle

enum

Whether the vehicle is new or used. Values supported are: New, Used, or CPO, meaning certified pre-owned.

Vehicle Specific Details

exterior_color

String

Vehicle exterior color.

Dealership Specific Details

address

object

A complete address for the dealership that must be resolvable to its location.

Dealership Specific Details

In address, addr 1, or address 1

String

Street address of dealership, such as 675 El Camino Real.

Dealership Specific Details

In address, city

String

City dealership is in, such as Palo Alto.

Dealership Specific Details

In address, region

String

State, county, region or province for dealership, such as California.

Dealership Specific Details

In address, country

String

Country, such as United States

Dealership Specific Details

In address, longitude

float

The longitude of the dealership such as -122.148252.

Optional fields include:

NameTypeDescription

chrome_id

int

Similar to autodata_id.

car_history_link

String

Link to a carfax report or other car history report

trim

String

Trim of the vehicle, such as "5DR HB SE"

tag (image tag)

String

A string that describes the image. There can be multiple tags associated with an image, such as "Exterior", "Interior", "StockImage"

interior_color

String

Vehicle interior color

condition

enum

Condition of the vehicle. Values expected are: excellent, good, fair, poor, or other.

sale_price

int

Sale price or special price.

video_ids

URL

Video IDs of the vehicle

availability

enum

Availability of the vehicle. Either available or not available. Note: We will not show vehicles that are not available in the ad

stock_number

String

A unique number, in addition to VIN and auto_id specified by manufacturer

dealer_id

String

Alphanumeric identifier of the dealer

dealer_name

String

Name of dealer

postal_code, in address object

String

Postal code, or zipcode of dealer

Fields that can be used in template tag: make, model, year, description, mileage.value, mileage.unit, title, price

You should provide template tags in double curly brackets: {{....}}

Before using template tags, make sure you provide all required details through your vehicle events.

For example, the title of your ad could be:

Checkout great deals from {{dealer_name}}

Use the template_url_spec field to specify the URL that appears after someone clicks on the ad. If you do not provide it, or we cannot derive it when we render an ad, we display the URL from the catalog.

You can show a single product or a carousel with multiple products. For single-product ads, you can show multiple images of the same product in the carousel, assuming your catalog contains multiple images for each product. You can also display static cards in combination with dynamic cards. For more information about creative options, see Dynamic Ads, Building a Creative Template.

Below is an example to create a carousel creative for Dynamic Ads for Auto.

use FacebookAds\Object\AdCreative;
use FacebookAds\Object\Fields\AdCreativeFields;
use FacebookAds\Object\Fields\AdCreativeLinkDataFields;
use FacebookAds\Object\Fields\AdCreativeObjectStorySpecFields;
use FacebookAds\Object\Values\AdCreativeCallToActionTypeValues;
use FacebookAds\Object\AdCreativeObjectStorySpec;
use FacebookAds\Object\AdCreativeLinkData;

$object_story_spec = new AdCreativeObjectStorySpec();
$object_story_spec->setData(array(
  AdCreativeObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
  AdCreativeObjectStorySpecFields::TEMPLATE_DATA =>
    (new AdCreativeLinkData())->setData(array(
      AdCreativeLinkDataFields::MESSAGE =>
        'Check out these vehicles from {{dealer_name}}',
      AdCreativeLinkDataFields::NAME => '{{vehicle.year}} {{vehicle.make}} {{vehicle.model}}',
      AdCreativeLinkDataFields::LINK => '{{vehicle.url}}',
      AdCreativeLinkDataFields::DESCRIPTION =>
        '{{vehicle.description}}',
      AdCreativeLinkDataFields::ADDITIONAL_IMAGE_INDEX => 0,
      AdCreativeLinkDataFields::CALL_TO_ACTION => array(
        'type' => AdCreativeCallToActionTypeValues::LEARN_MORE,
      ),
    )),
));

$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');
$creative->setData(array(
  AdCreativeFields::NAME => 'Dynamic Ad Template Creative Sample',
  AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
  AdCreativeFields::TEMPLATE_URL_SPEC =>
    array(
      'web' => array(
        'url' => 'http://www.example.com/vehicle'.
          '?id={{vehicle_id | urlencode}}',
      )
    ),
  AdCreativeFields::PRODUCT_SET_ID => <PRODUCT_SET_ID>,
));

$creative->create();

Use the ad_set_id and the creative_id to create the ad.

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();
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

Next Steps

Preview the ad

You can generate a preview of your dynamic creative with the Ad Previews API. Include the product_item_ids parameter to specify which catalog items will show up in the preview.

Generate a preview of your ad with the Ad Previews API. Include the product_item_ids to specify which catalog items appears in the preview, and start_date and end_date to specify specific dates.

use FacebookAds\Object\AdCreative;
use FacebookAds\Object\Fields\AdPreviewFields;
use FacebookAds\Object\Values\AdPreviewAdFormatValues;

$creative = new AdCreative(<CREATIVE_ID>);
$preview = $creative->getPreviews(array(), array(
  AdPreviewFields::AD_FORMAT => AdPreviewAdFormatValues::DESKTOP_FEED_STANDARD,
  AdPreviewFields::PRODUCT_ITEM_IDS => array(
    '<VEHICLE_FBID>',
  ),
));

Step 5: Monitor and Evaluate

To fetch ad Insights for a vehicle object, make a GET call to /insights. Remember to add vehicle_id to the breakdown parameter

To retrieve comments or "Likes" of a Dynamic Ad, use the Dynamic Post API.

FAQs

What is Dynamic Ads for Autos? It is a vertical solution for the Automotive industry which has custom creative format, data models, and ads delivery optimization important for Automotive clients

What does it do? We match the vehicle from your catalog with people whose activity on and off Facebook suggests they are interested in your vehicle. We determine which specific vehicle to display by evaluating intent signals of a person both on and off the Facebook apps as well as people that demonstrate similar characteristics.

Who should use it? - You are currently using the Dynamic Ads for driving automotive sales - You already use Facebook ads to drive sales and traffic from new customers with non-dynamic ads, and you want to improve performance of your ads and automate your work so that more products from your catalog can be advertised. - You want an always-on solution that will not only engage existing customers but also grow your business by driving traffic and converting new customers.

What do ads look like? Contact your Facebook representative to see samples.

How should I measure success? You should optimize for vehicle detail pages and cost per action that you Facebook pixel measures. Compare this against website conversion ads and or if you are currently using Dynamic Ads, compare with those campaigns.