PHPackages                             dbtlr/dfp-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dbtlr/dfp-bundle

AbandonedSymfony-bundle[API Development](/categories/api)

dbtlr/dfp-bundle
================

Symfony2 Bundle for integrating with the Google DFP Ad Network.

5755[2 PRs](https://github.com/dbtlr/NodrewDfpBundle/pulls)PHP

Since Sep 3Pushed 12y ago1 watchersCompare

[ Source](https://github.com/dbtlr/NodrewDfpBundle)[ Packagist](https://packagist.org/packages/dbtlr/dfp-bundle)[ RSS](/packages/dbtlr-dfp-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Google DFP Bundle for Symfony2 [![Travis-CI Build Status](https://camo.githubusercontent.com/d72e8318e56c0ab015a34744d0f1f8c56de23c1d9c058e7731b1fbcb0bb21355/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6e6f647265772f4e6f6472657744667042756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/#!/nodrew/NodrewDfpBundle)
==========================================================================================================================================================================================================================================================================================================================================================

[](#google-dfp-bundle-for-symfony2-)

Installation Instructions
-------------------------

[](#installation-instructions)

1. Download NodrewDfpBundle
2. Configure the Autoloader
3. Enable the Bundle
4. Add your Google DFP Publisher Id

### Step 1: Download NodrewDfpBundle

[](#step-1-download-nodrewdfpbundle)

Ultimately, the NodrewDfpBundle files should be downloaded to the `vendor/bundles/Nodrew/Bundle/DfpBundle` directory.

This can be done in several ways, depending on your preference. The first method is the standard Symfony2 method.

**Using the vendors script**

Add the following lines in your `deps` file:

```
[NodrewDfpBundle]
    git=http://github.com/nodrew/NodrewDfpBundle.git
    target=/bundles/Nodrew/Bundle/DfpBundle

```

Now, run the vendors script to download the bundle:

```
$ php bin/vendors install
```

**Using submodules**

If you prefer instead to use git submodules, then run the following:

```
$ git submodule add http://github.com/nodrew/NodrewDfpBundle.git vendor/bundles/Nodrew/Bundle/DfpBundle
$ git submodule update --init
```

### Step 2: Configure the Autoloader

[](#step-2-configure-the-autoloader)

```
// app/autoload.php

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
    // ...
    'Nodrew'   => __DIR__.'/../vendor/bundles',
));
```

### Step 3: Enable the bundle

[](#step-3-enable-the-bundle)

Finally, enable the bundle in the kernel:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Nodrew\Bundle\DfpBundle\NodrewDfpBundle(),
    );
}
```

### Step 4: Add your Google DFP Publisher Id

[](#step-4-add-your-google-dfp-publisher-id)

```
# app/config/config.yml
nodrew_dfp:
    publisher_id:   [publisher_id]
```

### Step 5: Add Control Code Placeholder to layout

[](#step-5-add-control-code-placeholder-to-layout)

This placeholder comment needs to be added to the head of your layout. It is automatically replaced with the proper Google DFP code, when ads are used on the given page.

```
// app/views/base.html.twig

    ...

```

Using Ad Units
--------------

[](#using-ad-units)

### In page unit.

[](#in-page-unit)

To use a standard in page ad unit, add the following to your template:

```
{{ dfp_ad_unit('some/campaign', [300, 250]) }}
```

The appropriate control codes will be added to the header, if everything was done correctly during setup.

### Out of page unit.

[](#out-of-page-unit)

If you're looking to do a DFP out of page unit, such as an interstitial, or a skin, then use this code. It is much similar, just without the size attached to it.

```
{{ dfp_oop_ad_unit('some/campaign') }}
```

The appropriate control codes will be added to the header, if everything was done correctly during setup.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/195095?v=4)[Drew Butler](/maintainers/dbtlr)[@dbtlr](https://github.com/dbtlr)

---

Top Contributors

[![dbtlr](https://avatars.githubusercontent.com/u/195095?v=4)](https://github.com/dbtlr "dbtlr (2 commits)")[![zhukova](https://avatars.githubusercontent.com/u/1797859?v=4)](https://github.com/zhukova "zhukova (1 commits)")

### Embed Badge

![Health badge](/badges/dbtlr-dfp-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dbtlr-dfp-bundle/health.svg)](https://phpackages.com/packages/dbtlr-dfp-bundle)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
