當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gapi::getPercentNewVisits方法代碼示例

本文整理匯總了PHP中gapi::getPercentNewVisits方法的典型用法代碼示例。如果您正苦於以下問題:PHP gapi::getPercentNewVisits方法的具體用法?PHP gapi::getPercentNewVisits怎麽用?PHP gapi::getPercentNewVisits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gapi的用法示例。


在下文中一共展示了gapi::getPercentNewVisits方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getGAgeneral

 function getGAgeneral()
 {
     $app =& JFactory::getApplication();
     $config = $app->getuserState('rsseoConfig');
     try {
         $ga = new gapi($config['analytics.username'], $config['analytics.password'], $config['ga.token']);
         $ga->requestReportData($config['ga.account'], '', array('visits', 'pageviews', 'pageviewsPerVisit', 'avgTimeOnSite', 'visitBounceRate', 'percentNewVisits', 'visitors'), null, null, $config['ga.start'], $config['ga.end']);
         $return = array();
         $totalvisits = $ga->getVisits();
         $totalvisits = $totalvisits === '' ? JText::_('RSSEO_NOT_AVAILABLE') : $totalvisits;
         $uniquevisits = $ga->getVisitors();
         $uniquevisits = $uniquevisits === '' ? JText::_('RSSEO_NOT_AVAILABLE') : $uniquevisits;
         $totalpageviews = $ga->getPageviews();
         $totalpageviews = $totalpageviews === '' ? JText::_('RSSEO_NOT_AVAILABLE') : $totalpageviews;
         $avgpageviews = $ga->getPageviewsPerVisit();
         $avgpageviews = $avgpageviews === '' ? JText::_('RSSEO_NOT_AVAILABLE') : number_format($avgpageviews, 2);
         $timeonsite = $ga->getAvgTimeOnSite();
         $timeonsite = $timeonsite === '' ? JText::_('RSSEO_NOT_AVAILABLE') : $this->convertseconds(number_format($timeonsite, 0));
         $bouncerate = $ga->getVisitBounceRate();
         $bouncerate = $bouncerate === '' ? JText::_('RSSEO_NOT_AVAILABLE') : number_format($bouncerate, 2) . ' %';
         $newvisits = $ga->getPercentNewVisits();
         $newvisits = $newvisits === '' ? JText::_('RSSEO_NOT_AVAILABLE') : number_format($newvisits, 2) . ' %';
         $obj1 = new stdClass();
         $obj2 = new stdClass();
         $obj3 = new stdClass();
         $obj4 = new stdClass();
         $obj5 = new stdClass();
         $obj6 = new stdClass();
         $obj7 = new stdClass();
         $obj1->title = JText::_('RSSEO_GA_GENERAL_TOTALVISIORS');
         $obj4->title = JText::_('RSSEO_GA_GENERAL_AVGPAGEVIEWS');
         $obj1->value = $totalvisits;
         $obj4->value = $avgpageviews;
         $obj1->descr = JText::_('RSSEO_GA_GENERAL_TOTALVISIORS_DESC');
         $obj4->descr = JText::_('RSSEO_GA_GENERAL_AVGPAGEVIEWS_DESC');
         $obj2->title = JText::_('RSSEO_GA_GENERAL_UNIQUEVISITS');
         $obj5->title = JText::_('RSSEO_GA_GENERAL_TIMEONSITE');
         $obj2->value = $uniquevisits;
         $obj5->value = $timeonsite;
         $obj2->descr = JText::_('RSSEO_GA_GENERAL_UNIQUEVISITS_DESC');
         $obj5->descr = JText::_('RSSEO_GA_GENERAL_TIMEONSITE_DESC');
         $obj3->title = JText::_('RSSEO_GA_GENERAL_TOTALPAGEVIEWS');
         $obj6->title = JText::_('RSSEO_GA_GENERAL_BOUNCERATE');
         $obj3->value = $totalpageviews;
         $obj6->value = $bouncerate;
         $obj3->descr = JText::_('RSSEO_GA_GENERAL_TOTALPAGEVIEWS_DESC');
         $obj6->descr = JText::_('RSSEO_GA_GENERAL_BOUNCERATE_DESC');
         $obj7->title = JText::_('RSSEO_GA_GENERAL_NEWVISITS');
         $obj7->value = $newvisits;
         $obj7->descr = JText::_('RSSEO_GA_GENERAL_NEWVISITS_DESC');
         $return[] = $obj1;
         $return[] = $obj2;
         $return[] = $obj3;
         $return[] = $obj4;
         $return[] = $obj5;
         $return[] = $obj6;
         $return[] = $obj7;
         return $return;
     } catch (Exception $e) {
         return $e->getMessage();
     }
 }
開發者ID:srbsnkr,項目名稱:sellingonlinemadesimple,代碼行數:62,代碼來源:analytics.php

示例2: round

?>
</strong></td></tr>
							<tr><td>Pages/Visit</td><td> <strong><?php 
echo round($ga->getPageViewsPerVisit(), 2);
?>
</strong></td></tr>
							<tr><td>Avg. Visit Duration</td><td> <strong><?php 
echo convertSecsToTime(round($ga->getAvgTimeOnSite()));
?>
</strong></td></tr>
							<tr><td>Bounce Rate</td><td> <strong><?php 
echo round($ga->getVisitBounceRate(), 2);
?>
 %</strong></td></tr>
							<tr><td>% New Visits</td><td> <strong><?php 
echo round($ga->getPercentNewVisits(), 2);
?>
 %</strong></td></tr>
							</table>
						</div>
					</div>
					<div class="span6">
						<div id="divPieChart"></div>
					</div>
				</div>
	        </div>
	    </div>
	</div>
	
<?php 
include 'footer.php';
開發者ID:rajasegar,項目名稱:brokerarena,代碼行數:31,代碼來源:ga_visits.php


注:本文中的gapi::getPercentNewVisits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。