0

我試圖用GAPI顯示前5名的非移動瀏覽器。 我似乎無法找到這樣做的方法,這甚至有可能嗎?
這是我得到的移動次數的百分比:Google Analytics(分析)PHP API(GAPI)非移動瀏覽器

$ga->requestReportData(GA_PROFILE_ID, array("isMobile"), array("visits"), '-visits', null, $startdate, $enddate); 
foreach ($ga->getResults() AS $result) { 

    if ((string)$result == "Yes") $mobile["yes"] = $result->getVisits(); 
    else $mobile["no"] = $result->getVisits(); 

} 

回答

1

這是我最後只是:

public function getDevices($max = 5) { 
    $this->ga->requestReportData($this->profileid, array('mobileDeviceInfo'), array('visits'), '-visits', 'mobileDeviceInfo != (not set) && mobileDeviceInfo != (not provided)', $this->startdate, $this->enddate, 1, $max); 
    foreach ($this->ga->getResults() as $result) { 
     $device[] = (string)$result; 
     $visits[] = $result->getVisits(); 
    } 
    if (!isset($device) OR !isset($visits)) { 
     $device[] = "Niet genoeg data beschikbaar"; 
     $visits[] = "0"; 
    } 
    $return = array("device" => $device, "visits" => $visits); 
    return $return; 
} 
+0

如何從mobiledeviceInfo刪除瀏覽器的詳細信息 – 2013-05-03 11:17:58

相關問題