1. jQuery implementation for Google DoubleClick for Publishers (DFP)

First Download jQuery DFP Plugin Here

Ad unit tester
You can use this page to test your DFP ads using the jquery.dfp.js script. There is some debug code included to help debug the ad delivery.

You can also use the Google Console to debug your ad units. This is done by by adding a “google_console=1” or “google_debug=1” to the url, and toggling the console by pressing CTRL + F10.

Placement Setup
You can add ad units to your page in any location that you would like to display an ad.

By default this script will look for ad units with a class of adunit but you can of course use jQuery selectors as well.

The minimum information required for an ad unit to function is having the ad unit specified. To do this you can use the id parameter of the element, for example:

You can add ad units to your page in any location that you would like to display an ad.
By default this script will look for ad units with a class of adunit but you can of course use jQuery selectors as well.
The minimum information required for an ad unit to function is having the ad unit specified. To do this you can use the id parameter of the element, for example:

<div class="adunit" id="Ad_unit_id"></div>

In the example above the ID of the div element will be used to look up a corresponding ad unit in DFP and the dimensions of the adunit will be set to the same dimensions of the div which could be defined in your CSS.
You can optionally specify the adunit name and dimensions in the following way:

<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176"></div>

This method can be useful for including multiple copies of an ad unit with the same name which when part of a DFP placement will then pull in as many different creatives as possible.
You can also specify multiple dimensions sets:

<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176,450x500"></div>

Also you can optionally specify custom targeting on a per ad unit basis in the following way:

<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-targeting='{"city_id":"1"}'></div>

Also you can optionally specify custom exclusion category on a per ad unit basis in the following way:

<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-exclusions="firstcategory,secondcategory"></div>

To create an out of page ad unit set the data-outofpage property on the ad unit. Dimensions are not required for out of page ad units.

<div class="adunit" data-adunit="Ad_unit_id" data-outofpage="true"></div>

In order to identify an add unit on the page that is a video companion ad, set the data-companion attribute on that unit.

<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-companion="true"></div>

For More details See here
Using DoubleClick for Publishers (DFP) to Deliver Ads on apps
Delivering Mobile Rich Media Ads to Mobile Apps
 How to integrate ads into a hybrid application

SHARE
Previous articleSEO advice : How to build canonical url ?
Next articleGetting Started First App Using the Intel® XDK?
Abdullah Al Mahamud is a programmer and founder of Thedevline an Inspiration blog since 2014. live in Bangladesh. He is passionate about Technology and Design. He works on the freelancing marketplace as a freelancer and has also written for Useful Article in this blog

Leave a Reply

avatar
  Subscribe  
Notify of