コード例 #1
0
 function render($data)
 {
     $site = $this->get('site');
     if ($site->get('name')) {
         $name = sprintf("%s (%s)", $site->get('domain'), $site->get('name'));
     } else {
         $name = $site->get('domain');
     }
     //page title
     $this->t->set('page_title', 'Tracking Tags');
     $this->body->set('site', $site);
     $this->body->set('name', $name);
     $this->body->set('options', array());
     // load body template
     $this->body->set_template('sites_invocation.tpl');
     $this->body->set('site_id', $this->get('site_id'));
     $this->body->set('tracking_code', owa_coreAPI::getJsTrackerTag($this->get('site_id')));
 }
コード例 #2
0
 /**
  * Returns a configured javascript tracker for inclusion in your web page.
  * You can pass an options array to control what the tracker will log.
  * The options array is a key/value pair format like:
  *
  * $options = array('do_not_log_pageview' => true);
  *
  * Option keys include: 'do_not_log_pageview', 'do_not_log_clicks', 'do_not_log_domstream'
  *
  * @param 	$echo		bool 	if true the function will echo. if false the tracker is returned asa string.
  * @param	$options	array	an key value pair option array 
  * @return 	$tag 		string	the tracker javascript.
  */
 function placeHelperPageTags($echo = true, $options = array())
 {
     if (!owa_coreAPI::getRequestParam('is_robot')) {
         // check to see if first hit tag is needed
         if (isset($options['delay_first_hit']) || owa_coreAPI::getSetting('base', 'delay_first_hit')) {
             $service =& owa_coreAPI::serviceSingleton();
             //check for persistant cookie
             $v = $service->request->getOwaCookie('v');
             if (empty($v)) {
                 $options['first_hit_tag'] = true;
             }
         }
         if (!class_exists('owa_template')) {
             require_once OWA_BASE_CLASSES_DIR . 'owa_template.php';
         }
         $t = new owa_template();
         $t->set_template('js_helper_tags.tpl');
         $tracking_code = owa_coreAPI::getJsTrackerTag($this->getSiteId(), $options);
         $t->set('tracking_code', $tracking_code);
         $tag = $t->fetch();
         if ($echo == false) {
             return $tag;
         } else {
             echo $tag;
         }
     }
 }