Search code examples
google-dfpresponsivemulti-targeting

DFP multi tags ordering


I would like to render in priority the first ad (300x250), then the second (300x600) if the first one is not available. In facts the following code render randomly the first and the second Ads. Is there a way to implements this or should i do two calls instead ?

slot1 = googletag.defineSlot('__mySlot_', [[300,250],[300,600]], 'div-gpt-ad-multifunctionnal-1') 
            .addService(googletag.pubads());
    googletag.enableServices();
    googletag.display('div-gpt-ad-multifunctionnal-1');

My rotate creatives line Item property is setted at "evenly"


Solution

  • In you DFP Line Item you should give a weight to your creatives so, the ones with more weight will have more priority and will be served before the others. You can check here how to set up weights.

    But if what you need is to try 100% of times the first size and then the second when the first is empty, you will have to use different lineItems with different priorities so when the line with more priority is empty, DFP will serve the second line automatically.