JSPM

react-simple-dfp

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q25700F
    • License MIT

    A simple React component for DFP - DoubleClick for Publishers.

    Package Exports

    • react-simple-dfp

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-simple-dfp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    react-simple-dfp

    A simple React component for DFP - DoubleClick for Publishers.

    Install

    npm install react-simple-dfp

    Sample Usage

    <Dfp adUnitPath='/6355419/Travel' adSize={[728, 90]} adTargeting={{ test: 'infinitescroll' }}/>

    Props

    adUnitPath

    {string}, required Full path of the ad unit with the network code and unit code.

    Example

    "/6355419/Travel"

    adSize

    {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

    [728, 90]

    adElementId

    {string}, optional ID of the DOM element that will contain this ad unit.

    Example

    "div-gpt-ad-1234567890123-0"

    adTargeting

    {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

    {
        "test": "infinitescroll",
        "sport": ["rugby", "rowing"]
    }

    adStyle

    {object}, optional CSS Style for this component.

    Example

    {
        "padding": "20px",
        "background": "#fff"
    }

    adCollapse

    {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

    false

    onSlotRenderEnded

    {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.

    onImpressionViewable

    {func}, optional This event is fired when an impression becomes viewable, according to the Active View criteria.

    Demo

    git clone git@github.com:amobiz/react-simple-dfp.git
    cd react-simple-dfp
    open index.html

    Issues

    Issues

    Similar Projects

    License

    MIT

    Author

    Amobiz