Extend Async DFP provider script to support multiple width & height configurations #55

Open
natebot opened this Issue Feb 28, 2013 · 8 comments

Comments

Projects
None yet
5 participants
@natebot

natebot commented Feb 28, 2013

DFP using async tags now allows ad slots to be defined with variable dimensions. A single ad tag can, for example, display either a 300x250 or a 300x600 ad. The Async DFP provider script should support defining ad tags with multiple dimensions.

@danielbachhuber

This comment has been minimized.

Show comment Hide comment
@danielbachhuber

danielbachhuber Feb 28, 2013

Collaborator

What logic determines which size ad is run?

Collaborator

danielbachhuber commented Feb 28, 2013

What logic determines which size ad is run?

@natebot

This comment has been minimized.

Show comment Hide comment
@natebot

natebot Feb 28, 2013

The logic is internal to Google's async scripts. On our site we define a slot like this:

googletag.defineSlot('/2154169/300x250_Pos1', [[300, 600], [300, 250]], 'div-gpt-ad-1358981053960-0').addService(googletag.pubads());

Instead of defining ad code args for width and height, why not accept an array?

$this->ad_tag_ids[] = array( 
    'tag'       => '300x250_300x600',
    'url_vars'  => array( 'tag'  => '300x250_300x600',
        'dimension'    => array( array('300','250' ), array('300','600') )  
                        ),
                    'enable_ui_mapping' => true,
                );

natebot commented Feb 28, 2013

The logic is internal to Google's async scripts. On our site we define a slot like this:

googletag.defineSlot('/2154169/300x250_Pos1', [[300, 600], [300, 250]], 'div-gpt-ad-1358981053960-0').addService(googletag.pubads());

Instead of defining ad code args for width and height, why not accept an array?

$this->ad_tag_ids[] = array( 
    'tag'       => '300x250_300x600',
    'url_vars'  => array( 'tag'  => '300x250_300x600',
        'dimension'    => array( array('300','250' ), array('300','600') )  
                        ),
                    'enable_ui_mapping' => true,
                );
@danielbachhuber

This comment has been minimized.

Show comment Hide comment
@danielbachhuber

danielbachhuber Feb 28, 2013

Collaborator

Let me think about the best way to handle this and get back to you.

Collaborator

danielbachhuber commented Feb 28, 2013

Let me think about the best way to handle this and get back to you.

@rinatkhaziev

This comment has been minimized.

Show comment Hide comment
@rinatkhaziev

rinatkhaziev Feb 28, 2013

Collaborator

How about keeping the old width params as legacy fallback, and they're present, parse into new format?

Collaborator

rinatkhaziev commented Feb 28, 2013

How about keeping the old width params as legacy fallback, and they're present, parse into new format?

@danielbachhuber

This comment has been minimized.

Show comment Hide comment
@danielbachhuber

danielbachhuber Mar 17, 2013

Collaborator

@natebot let's work this out tomorrow so we can get it in v0.4

Collaborator

danielbachhuber commented Mar 17, 2013

@natebot let's work this out tomorrow so we can get it in v0.4

@danielbachhuber

This comment has been minimized.

Show comment Hide comment
@danielbachhuber

danielbachhuber Mar 19, 2013

Collaborator

I'm going to punt this to 0.5-early, so we aren't merging things into v0.4 at the last minute.

Collaborator

danielbachhuber commented Mar 19, 2013

I'm going to punt this to 0.5-early, so we aren't merging things into v0.4 at the last minute.

@NRG-R9T

This comment has been minimized.

Show comment Hide comment
@NRG-R9T

NRG-R9T Apr 17, 2013

Contributor

https://support.google.com/dfp_sb/bin/answer.py?hl=en&answer=2372721&expand=googletag_details#defineSlot

defineSlot

googletag.defineSlot(unitName, sizes, divId)
Constructs an ad slot with a given ad unit name and size and associates it with the ID of a div element on the page that will contain the ad.

Parameters:
string unitName - Full path of the ad unit with the network code and unit name.
number sizes - Width and height of the ad unit within brackets and separated by a comma. You can specify more than one size using this syntax: [[width1, height1], [width2, height2]]
string divId - Publisher-specified ID for the div element containing the ad.

Returns:
adSlot - The newly created ad slot.

Example:
// Ad unit = "/networkCode/unitName"; sizes = [[width1, height1], [width2, height2]]
googletag.defineSlot("/1234567/leaderboard", [[468, 60], [728, 90]], "div-1");
Contributor

NRG-R9T commented Apr 17, 2013

https://support.google.com/dfp_sb/bin/answer.py?hl=en&answer=2372721&expand=googletag_details#defineSlot

defineSlot

googletag.defineSlot(unitName, sizes, divId)
Constructs an ad slot with a given ad unit name and size and associates it with the ID of a div element on the page that will contain the ad.

Parameters:
string unitName - Full path of the ad unit with the network code and unit name.
number sizes - Width and height of the ad unit within brackets and separated by a comma. You can specify more than one size using this syntax: [[width1, height1], [width2, height2]]
string divId - Publisher-specified ID for the div element containing the ad.

Returns:
adSlot - The newly created ad slot.

Example:
// Ad unit = "/networkCode/unitName"; sizes = [[width1, height1], [width2, height2]]
googletag.defineSlot("/1234567/leaderboard", [[468, 60], [728, 90]], "div-1");
@harvitronix

This comment has been minimized.

Show comment Hide comment
@harvitronix

harvitronix Jul 23, 2013

Contributor

@natebot @danielbachhuber I didn't see this issue until after the fact but have made a pull request to address this. It's here: #82

Contributor

harvitronix commented Jul 23, 2013

@natebot @danielbachhuber I didn't see this issue until after the fact but have made a pull request to address this. It's here: #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment