react-simple-dfp
A simple React component for DFP - DoubleClick for Publishers.
Install
``bash
npm install react-simple-dfp
`
Sample Usage
`jsx
`
Props
$3
{string}, required
Full path of the ad unit with the network code and unit code.
#### Example
`json
"/6355419/Travel"
`
$3
{array}, required
Width and height of the added slot. This is the size that is used in the ad request if no responsive size mapping is provided or the size of the viewport is smaller than the smallest size provided in the mapping.
#### Example
`json
[728, 90]
`
$3
{string}, optional
ID of the DOM element that will contain this ad unit.
#### Example
`json
"div-gpt-ad-1234567890123-0"
`
$3
{object}, optional
Sets a custom targeting parameter for this slot. Values set here will overwrite targeting parameters set on the service that this slot uses.
#### Example
`json
{
"test": "infinitescroll",
"sport": ["rugby", "rowing"]
}
`
$3
{object}, optional
CSS Style for this component.
#### Example
`json
{
"padding": "20px",
"background": "#fff"
}
`
$3
{bool}, optional
Sets whether the slot component should be hidden when there is no ad in the slot. This overrides the service-level settings.
#### Example
`json
false
`
$3
{func}, optional
This event is fired when a slot on the page has finished rendering. The event is fired by the service that rendered the slot. Example: To listen to companion ads, add a listener to the companionAds service, not the pubads service.
$3
{func}, optional
This event is fired when an impression becomes viewable, according to the
Active View criteria.
Demo
`bash
git clone git@github.com:amobiz/react-simple-dfp.git
cd react-simple-dfp
open index.html
``
Issues
Issues
Similar Projects
* dfp-events
* jquery.dfp.js
* ngDfp
* node-google-dfp
* react-dfp
License
MITAuthor
Amobiz