How to manage Google Ads by integrating DFP (DoubleClick for Publishers) with your Drupal 9 websiteKiran Singh30 Jun, 2020

As a publisher, it is especially important for you to get the most of what is offered when it comes to pay-per-click advertising. While selling or buying ads in the ad space can be complex, Google allows granular control over all your ads and configurations through Google Ad Manager. Combine this incredible ad management platform with Drupal 9's easy to use integration methods, and you will be able to manage multiple ads on your site while providing insightful reports for better optimization.

DFP Integrate

What is DFP?

Google Ad Manager, previously known as Doubleclick for Publishers (DFP) is an ad server which helps the individuals or business with a good number of page views to generate revenue from their pages on the site. This ad platform facilitates both the buying and selling of ads across various ad networks and multiple locations. Google offers its ad server in two variants – Google Ad Manager for Small Business (completely free) and Google Ad Manager 360. It should be noted that the small business offering has some limited features but works well for small to medium-sized businesses.

How to configure Google Ad Manager

1. Creating Ad Units - Ad Units are basic components of the Ad Manager. It defines the size of the ad and specific location of the Ad on your website or app where you want to display the ads.
Below is a sample screenshot of an Ad unit configured on the Ad manager account.

DFT - Integration

2. Delivering Ad unit - For delivering corresponding add units, we need to add Orders, Line items & Creatives.
•    The Orders in Google Ad manager, where we need to add advertiser & trafficker, in other word we can say if company A wants to buy ad space in our site, the first step to setting them up is to create their order in our google Ad manager account as all subsequent line items within this order.
•    Now create line item which holds information about the specific run dates, targeting, and pricing of one or more creatives.
•    A creative is a specific advertisement, such as an image file, a video file, or other content. One creative can be associated with more than one line item.

How to integrate DFP with Drupal 9

1. First, install and enable the DFP module.
2. Under structure menu, go to DFP Add tags. We have to set Network ID (prepending with “/“ (eg: /111111)  in global DFP settings tab which we will get from the Google Ad manager account. Save the configuration.

DFP Integrate


3. Fill up the following details in the Add DFP tag form.
   Ad Slot Name → Use the same label of Ad Unit configured in Google Ad manager account
   Size(s) → Copy the same sizes of Ad Unit configured in Google Ad manager account
   Ad Unit Pattern → Copy the exact pattern from the “Code“ of Ad unit configured in Google Ad manager account
  Under “Display Options”, make sure “Create a block for this ad tag“ is checked.
4. Save the Form. This will create a block with the required ad script.
5. Place the Block wherever it is required using either Structure / Block layout (for all pages).

Shefali ShettyApr 05, 2017