本文整理汇总了PHP中owa_coreAPI::getJsTrackerTag方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::getJsTrackerTag方法的具体用法?PHP owa_coreAPI::getJsTrackerTag怎么用?PHP owa_coreAPI::getJsTrackerTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::getJsTrackerTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
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: placeHelperPageTags
/**
* 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;
}
}
}