Caution: This plugin is still in Experimental state
DoubleClick for Publishers is an online advertising system owned by Google.
This service can be used in combination with Google AdSense.
Disclaimer:
I'm not in any case affiliate to DoubleClick for Publishers. DoubleClick for Publishers is the property of Google.
I disclaim all warranties and I'll not be responsible for the use of DFP Manager.
DFP Manager is a Wordpress plugin to create and manage Ad Units via the DFP API.
Create your Ad Slots, define Ad Sizes and your Ad Units will be created/updated on post publish/update.
- Remote Ad Units creation with DFP API
- Ad Slots management
- Ad Sizes management
- General settings
- Advanced settings
-
Ad Unit prefix
For example your site language code like ja_ or for environments purpose test_, staging_, prod_, etc...
-
Include "Post type"
In case you use custom posts, you can append the post type to the Ad Unit name/code
-
You'll need to install php-soap extension as DFP API is based on this protocol.
Ubuntu/Debian like:
$ sudo apt-get install php-soap
RHEL/Fedora like:
$ sudo yum install php-soap
- Git clone the repo in your
/wp-content/plugins/
directory - Go to your WP dashboard -> Plugins -> Installed Plugins
- Activate DFP Manager
You can use the awesome plugin github-updater to keep dfp-manager up to date or just use git pull
command.
Note: I also plan to release this plugin on Wordpress.org plugins repository in a near future
- Go to DFP Manager -> General Settings
- Enter your Network Code
- Enter an Application Name
- Upload your JSON API Key file to allow the plugin to access your DFP Manager account API
Don't forget that you should allow API access in your DFP account settings
- Add an Ad Unit Prefix if you want to recognize created Ad Units (for example: wp_ for Wordpress)
- Check include "Post Type" to add the post_type corresponding to your Ad Unit (like post, page or custom_posts names)
- You can fill Ad Slot Prefix in case you want to customize IDs for your frontend Ad Units Slots
For example with an Ad Slot Prefix set to ad-banner-:
googletag.defineSlot('/5048360/test_12_post_C', [[100,100]], 'ad-banner-C').addService(googletag.pubads());
DFP Manager hook will be executed everytime you Save / Update or Publish a Wordpress post. It will check if the Ad Unit is already present in your DFP account otherwise it will create it for you.
Caution: In case an Ad Unit already exists and is archived, the plugin will not reactivate it for you.
Don't forget to register your Network Code, Application Name and to upload your credentials JSON file in the General Settings page.
-
Go to
includes
directory of dfp-manager plugin. -
Execute:
php class-dfp-cli-example.php
-
Result:
0) An ad unit with ID '21620414035' and name 'test_5976e475523ad' was created.
Created 1 ad unit(s).
Coming soon...
- Delete custom taxonomy on plugin uninstall
- Upgrade to last DFP API
- Custom post filtering function in advanced settings
- List custom posts and check the ones you want to use DFP Manager
- This will enable/disable publish hook for these custom posts
- Add a plugin share hook (public + private)
- Clean up all the stuff on plugin uninstall (like DFP API key)
- Ad Unit menu item in DFP Manager to list them (remotely from DFP)
- Post: DFP Manager metabox info (Ad Unit already created or not? Present in a DFP Placement?)
- Worpdress shortcode for DFP Manager
- Populate Ad Sizes on plugin installation
- Code refactoring in general
- CSV importer to bulk upload a huge amount of Ad Units (more than the 1,000 Ad Units proposed by DFP bult-in feature)
- Add an option to rename all created Ad Units slots or change all Ad Unit sizes
- General Settings
- Advanced Settings
- DFP configuration parameters
- DFP Key upload
- Ad Slots (custom post)
- Ad Sizes (taxonomy)
- Publish hook for Ad Units creation
-
wp_header
hook for DFP JS script loader - Add an option to custom ad banners name for responsive_ads_header
- Code refactoring (like taxonomy registration and custom_post)
- Background job for Ad Units creation
- Add (Optional) to Endpoint
- [Installed Application] or [Web Application Flow] checkbox
- Delete DFP key folder on plugin uninstall
Coming soon...
Feel free to contribute to this open-source project :)
Hey dude! Help me out for a couple of 🍻!