jaanauati / react-dfp

A React implementation of the Google DFP/GPT api. https://react-dfp.surge.sh
MIT License
127 stars 53 forks source link

Disable SingleRequest mode #90

Closed shotap closed 5 years ago

shotap commented 5 years ago

Hi, is there any way to disable SingleRequest mode?

jaanauati commented 5 years ago

umm, nope, but I guess that just adding a new prop and a conditional surrounding the following line should do it: https://github.com/jaanauati/react-dfp/blob/master/js/manager.js#L200

if time allows me, I will try to push a tweak in the following days.

thanks.

jaanauati commented 5 years ago

ok, I've just made the updates to the api, example:

            <DFPSlotsProvider singleRequest={false} dfpNetworkId='9999'>
                <div className="desktop-ads">
                    <AdSlot sizes={[[728,90], [300, 250]]} adUnit='homepage/1' />
                </div>
                <div className="mobile-ads">
                    <AdSlot sizes={[[320,50], [300, 50]]} adUnit='homepage/mobile' />
                </div>
            </DFPSlotsProvider

please give it a try and let me know if it works for u.

thanks.

shotap commented 5 years ago

looks great!