Dynamic Ads

Dynamic Ads are ads dynamically created by populating an ad template with product information found in a data feed. This allows you to create thousands of ads without having to configure each of them individually. You can also use Dynamic Ads to target visitors based on how they have interacted with your website in the past.

The general steps for creating Dynamic Ads are:

  1. Set up conversion tracking for the specific standard events and their parameter object properties listed below, then
  2. Use the Catalog Manager to set up a dynamic ad set that targets those events

Requirements

  • You must have a Facebook Page for the business that your dynamic ads will apply to.
  • The pixel base code must already be installed.
  • You must have access to the Facebook Ads Manager.

Standard Events

Before you can set up dynamic ads, you must first be tracking the following standard events. You must also include a parameter object with specific object properties with each tracked event.

Required EventRequired Object Properties

AddToCart

content_type and either content_ids or contents

Purchase

content_type and either content_ids or contents

ViewContent

content_type and either content_ids or contents

Refer to the Object Properties section below to learn what values to assign to the required object properties.

Object Properties

content_type

The content_type object property's value must be set to either product, or product_group, depending on how you will configure your data feed when you set up your product catalog in the Catalog Manager.

If you will be tracking events associated with individual products, set the value to product. If you are tracking events associated with product groups, set it to product_group instead.

For example, here's how you could track a visitor who has added the product with the ID 201 to a shopping cart. The ID matches the ID for that product in the product catalog.

fbq('track', 'AddToCart',
  // begin required parameter object
  {
    value: .5,
    currency: 'USD',
    content_type: 'product', // required property
    content_ids: '201' // required property, if not using 'contents' property
  }
  // end required parameter object
);

content_ids

If you are using the content_ids property in your parameter object, its value should correspond to the product ID or product IDs associated with the action. IDs must match the IDs found in your product catalog. Values can be either single IDs, or an array of IDs.

For example, here's how to track a visitor who has added products with the IDs 201 and 301 to a shopping cart. The IDs match the IDs for those products in the product catalog.

fbq('track', 'AddToCart',
  // begin required parameter object
  {
    value: .5,
    currency: 'USD',
    content_type: 'product', // required property
    content_ids: ['201', '301'] // required property, if not using 'contents' property
  }
  // end required parameter object
);

contents

If you are using the contents property in your parameter object, you must include the id property in a sub-object, with the product ID or product IDs as its value. IDs must match the IDs found in your product catalog. contents property values can be a single object or an array of objects.

For example, here's how to track a visitor who has added a product with the ID 301, and two products with the ID 401, to a shopping cart. The IDs match the IDs for those products in the product catalog.

fbq('track', 'AddToCart', {
  value: .5,
  currency: 'USD',
  contents: [
    {
      id: '301',
      quantity: 1,
      item_price: 130.00
    },
    {
      id: '401',
      quantity: 2,
      item_price: 15.00
    }],
  content_type: 'product',
});

Catalog Manager

Once you have confirmed that the Events Manager is tracking your standard events correctly, use the Catalog Manager to set up your product catalog and dynamic ad template, and target the standard events. Follow our Set Up Dynamic Ads for Products Business Manager help document to do this.

After you complete all of the steps outlined in the document, be sure to use the Catalog Manager to verify that your catalog recognizes your pixel's events as a data source.

Note that it can take up to 24 hours for the Catalog Manager's Events Data Sources tab to recognize your tracked events.