Integrate ads in your Instant Articles

The following document provides an overview for integrating Audience Network ads within Facebook Instant Articles, using a JavaScript tag.

You can deploy the JavaScript tag directly into your HTML Article source code or within a third party ad server.

Getting Started

Create a placement ID:

  1. Go to My Apps and choose the app you want to add Audience Network to, and then go to Audience Network in your app dashboard.
  2. In Audience Network, go to Placements and click Create Ad Placement.
  3. Enter a Name for the placement and select Banner as the Display Format.
  4. Click Save.

Reporting is tied to a placement ID. Please make sure to use different placements if you care to track reporting by unique ad locations in Instant Articles.

You will find the option to click "Get Code" to generate your JavaScript tag.
Alternatively, you may input the Placement ID in the template tag provided below.

Deploying JavaScript tag in HTML page source code

Enter the following ad tag into your HTML source code:

<figure class="op-ad">
   <iframe width="300" height="250" style="border:0; margin:0;" src="https://www.facebook.com/adnw_request?placement=PLACEMENT_ID&adtype=banner300x250"></iframe>
</figure>

Configure the Placement ID you created in the first step within the ad tag.

The iframe in the template tag above has border and margin set to zero in order to ensure the optimal ad experience within Instant Articles.

Deploying JavaScript tag in your ad server

Include your ad server tag within Instant Article HTML markup using the "op-ad" figure class. Please note Instant Articles require ads to be placed in iframes.

<figure class="op-ad">
   <!-- Use this for your ads -->
   <iframe src="https://www.adserver.com/ss;adtype=banner300x250" height="250" width="300"></iframe>
</figure>

To request Audience Network via your ad server, call the Audience Network JavaScript tag directly, as demonstrated below:

<iframe width="300" height="250" style="border:0; margin:0;" src="https://www.facebook.com/adnw_request?placement=PLACEMENT_ID&adtype=banner300x250"></iframe>

Configure the Placement ID you created in the first step within the ad tag.

Please note, including extra code with the Audience Network JavaScript tag may result in errors in ad alignment.

Completing setup and monitoring performance

Please fill out your account and tax info under the Payout tab. You may go live without these details, though ad delivery will pause if your account balance reaches $100 before Payout details are complete.

To access the dashboards, in your app's settings page, click on Audience Network and then choose the Performance tab.

In addition, you can access your performance data via an API. Please see this guide for more info.