Ejemplo n.º 1
0
 public function getAd($slotname, $slot, $params = null)
 {
     $cwtagid = self::getCwtagid($slot);
     if (empty($cwtagid)) {
         $NullAd = new AdProviderNull("cwtagid must be supplied", true);
         return $NullAd->getAd($slotname, $slot);
     }
     $out = "<!-- " . __CLASS__ . " slot: {$slotname} -->";
     $dim = AdEngine::getHeightWidthFromSize($slot['size']);
     $url = "http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=" . $slot['size'] . "&cwpid=" . $this->cwpid . "&cwwidth=" . $dim['width'] . "&cwheight=" . $dim['height'] . "&cwpnet=1&cwtagid=" . urlencode($cwtagid);
     $out .= '<script type="text/javascript" src="' . $url . '"></script>';
     return $out;
 }
Ejemplo n.º 2
0
    public function getAd($slotname, $slot, $params = null)
    {
        $kadid = $this->getKadid($slotname);
        if (empty($kadid)) {
            $NullAd = new AdProviderNull("This slotname not available for AdProviderPubMatic", true);
            return $NullAd->getAd($slotname, $slot);
        }
        $dim = AdEngine::getHeightWidthFromSize($slot['size']);
        $out = "<!-- " . __CLASS__ . " slot: {$slotname} -->";
        $out .= '<script type="text/javascript">
			var pubId="' . addslashes($this->pubId) . '";
			var siteId="' . addslashes($this->siteId) . '";
			var kadId="' . addslashes($kadid) . '";
			var kadwidth="' . addslashes($dim['width']) . '";
			var kadheight="' . addslashes($dim['height']) . '";
			var kadtype=1;' . '</script>' . "\n" . '<script type="text/javascript" src="http://ads.pubmatic.com/AdServer/js/showad.js"></script>';
        return $out;
    }
Ejemplo n.º 3
0
    public function getAd($slotname, $slot, $params = null)
    {
        $dim = AdEngine::getHeightWidthFromSize($slot['size']);
        $out = "<!-- " . __CLASS__ . " slot: {$slotname} -->";
        $out .= '<script type="text/javascript">/*<![CDATA[*/
				google_ad_client = "pub-4086838842346968";
				google_ad_width	 = "' . $dim['width'] . '";
				google_ad_height = "' . $dim['height'] . '";
				google_ad_format = google_ad_width + "x" + google_ad_height + "_as";
				google_ad_type   = "text";
				google_ad_region = "region";' . "\n";
        $channel = $this->getChannel();
        $out .= 'google_ad_channel = "' . addslashes($channel) . '";' . "\n";
        /* Channel is how we do bucket tests.
         * Testing the effectiveness of google_page_url and google_hints here
         * The first test showed that hints performed better than the control and page_url
         * Now testing control vs hints alone vs hints + page_url
         */
        if ($channel == '9000000009') {
            // page_url + hints. Rumor has it these two are mutually exclusive, but we are trying it anyway.
            $out .= 'google_page_url = "' . addslashes($this->getPageUrl()) . '";' . "\n";
            $out .= $this->getGoogleHints() . "\n";
        } else {
            if ($channel == '9000000010') {
                // Control
            } else {
                if ($channel == '9000000011') {
                    // Hints alone
                    $out .= $this->getGoogleHints() . "\n";
                }
            }
        }
        $out .= '/*]]>*/</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
        return $out;
    }
Ejemplo n.º 4
0
 public function getAd($slotname, $slot, $params = null)
 {
     $out = "";
     // First time the ad is called, call all the batch code, if it hasn't already been called.
     if (!$this->setupHtmlCalled) {
         $out .= $this->getSetupHtml();
     }
     if (!$this->batchHtmlCalled) {
         $out .= $this->getBatchCallHtml();
     }
     $dim = AdEngine::getHeightWidthFromSize($slot['size']);
     if ($this->iframeRendering) {
         // I had to ask them to get this turned on
         $args = array($this->adManagerId, $slotname, $dim['width'], $dim['height']);
         return $out . '<script type="text/javascript">GA_googleFillSlotWithSize("' . implode('","', $args) . '");</script>';
     } else {
         return $out . '<script type="text/javascript">GA_googleFillSlot("' . $slotname . '")</script>';
     }
 }