You are here

function google_admanager_gpt_async_display_ad in DFP Small Business (Google Ad Manager) 6.3

1 string reference to 'google_admanager_gpt_async_display_ad'
gpt_async.inc in plugins/ad_providers/gpt_async.inc

File

plugins/ad_providers/gpt_async.inc, line 71

Code

function google_admanager_gpt_async_display_ad($ad_slot, $conf) {
  $script = "  googletag.defineSlot('/{$conf['account']}/{$ad_slot['name']}', [{$ad_slot['width']}, {$ad_slot['height']}], 'gam-holder-{$ad_slot['name']}').addService(googletag.pubads())" . google_admanager_gpt_async_targetting() . ';';
  google_admanager_add_js($script, 'slot', -1);
  $script = "googletag.cmd.push(function() {googletag.display('gam-holder-{$ad_slot['name']}');});";
  $style = 'width:' . $ad_slot['width'] . 'px;height:' . $ad_slot['height'] . 'px;';
  return '<div id="gam-holder-' . $ad_slot['name'] . '" class="gam-holder" style="' . $style . '"><script type="text/javascript">' . $script . '</script></div>';
}