本文整理汇总了PHP中gapi::getnewVisits方法的典型用法代码示例。如果您正苦于以下问题:PHP gapi::getnewVisits方法的具体用法?PHP gapi::getnewVisits怎么用?PHP gapi::getnewVisits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gapi
的用法示例。
在下文中一共展示了gapi::getnewVisits方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
function __construct($email, $password, $uid, $start_date = null, $end_date = null)
{
$filter = '';
$this->initialstartdate = date('M j Y', strtotime($start_date));
$this->initialenddate = date('M j Y', strtotime($end_date));
$start_index = 1;
$perdayCounts = $this->createDateRangeArray($start_date, $end_date);
$max_result = 1000000000;
$ga = new gapi($email, $password);
$ga->requestReportData($uid, array('date', 'source', 'medium', 'referralPath'), array('pageviews', 'visits', 'entranceBounceRate', 'timeOnSite', 'newVisits'), 'date', $filter, $start_date, $end_date, $start_index, $max_result);
$result = $ga->getResults();
$this->pageViews = $ga->getPageviews();
$this->visits = $ga->getVisits();
$this->bounceRate = $ga->getentranceBounceRate();
$this->timeOnSite = $ga->gettimeOnSite() / $this->visits / 60;
$this->newVisits = round($ga->getnewVisits() / $this->visits * 100, 2);
foreach ($result as $key => $value) {
$this->source[] = array('medium' => $value->getMedium(), 'visit' => $value->getVisits(), 'source' => $value->getSource());
$this->dateWise[] = array($value->getDate() => $value->getPageviews());
}
foreach ($perdayCounts as $day) {
$new_array = '';
foreach ($this->dateWise as $breakPoint) {
foreach ($breakPoint as $key => $value) {
if ($key == $day) {
$new_array[] = $value;
}
}
}
$this->valueCountsPerDay[] = array($day => array_sum($new_array));
}
}
示例2: date
$data_ricerca_anno = date("Y-m-d", time() - 86400 * $giorni_anno);
$data_ricerca_mese = date("Y-m-d", time() - 86400 * $giorni_mese);
$data_ricerca_settimana = date("Y-m-d", time() - 86400 * $giorni_settimana);
$data_ricerca_giorno = date("Y-m-d", time() - 86400 * $giorni_giorno);
$oggi = date("Y-m-d");
$ga = new gapi(ga_email, ga_password);
//////////////
// GIORNO
//////////////
$ga->requestReportData(ga_profile_id, array('visitorType'), array('visitors', 'pageviews', 'visits', 'timeOnSite', 'avgtimeOnsite', 'percentNewVisits', 'newVisits', 'pageviewsPerVisit', 'uniquePageviews'), '', '', $data_ricerca_giorno, date("Y-m-d"), 1, 1000);
echo "<div class=\"gacounter\">";
echo "<h3>Periodo osservazione: ultimo giorno </h3>";
echo "<p> dal " . date("d-m-Y", time() - 86400 * $giorni_giorno) . " al " . date("d-m-Y") . "</p>";
echo "<ul><li>visite totali: " . $ga->getVisits() . "</li>";
echo "<li class=\"alternato\">visitatori totali: " . $ga->getVisitors() . "</li>";
echo "<li>nuovi visitatori: " . $ga->getnewVisits() . "</li>";
echo "<li class=\"alternato\">pagine viste: " . $ga->getPageviews() . "</li>";
echo "<li>pagine viste per visita: " . round($ga->getpageviewsPerVisit(), 2) . "</li>";
echo "<li class=\"alternato\">pagine uniche: " . $ga->getuniquePageviews() . "</li>";
$t_medio = tempo_medio($ga->getavgTimeOnSite());
echo "<li>tempo medio di permanenza sul sito: " . $t_medio . "</li></ul>";
echo "</div>";
//////////////
// SETTIMANA
//////////////
$ga->requestReportData(ga_profile_id, array('visitorType'), array('visitors', 'pageviews', 'visits', 'timeOnSite', 'avgtimeOnsite', 'percentNewVisits', 'newVisits', 'pageviewsPerVisit', 'uniquePageviews'), '', '', $data_ricerca_settimana, date("Y-m-d"), 1, 1000);
echo "<div class=\"gacounter\">";
echo "<h3>Periodo osservazione: ultimi 7 giorni</h3>";
echo "<p> dal " . date("d-m-Y", time() - 86400 * $giorni_settimana) . " al " . date("d-m-Y") . "</p>";
echo "<ul><li>visite totali: " . $ga->getVisits() . "</li>";
echo "<li class=\"alternato\">visitatori totali: " . $ga->getVisitors() . "</li>";
示例3: substr
<td>Visite totali:</td>
<td align="center"><b><?php
echo $ga->getVisits();
?>
</b><br>(tempo medio: <?php
echo substr(tempo_medio($ga->getavgTimeOnSite()), 3);
?>
)</td>
</tr>
<tr>
<td>Visitatori totali:</td>
<td align="center"><b><?php
echo $ga->getVisitors();
?>
</b><br>(nuovi visitatori: <?php
echo $ga->getnewVisits();
?>
)</td>
</tr>
<tr>
<td>Pagine viste:</td>
<td align="center"><b><?php
echo $ga->getPageviews();
?>
</b><br>(pagine per visita: <?php
echo round($ga->getpageviewsPerVisit(), 2);
?>
)</td>
</tr>
</table>
<?php