Tjoosten / gapi-google-analytics-php-interface

Automatically exported from code.google.com/p/gapi-google-analytics-php-interface
0 stars 0 forks source link

total visits problem? #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
my web is visible that last one visits, last week visits, last month visits, 
last year visits and total visits. But my total visits less than total last 
year. what's problem there. and that's my code:

$ga->requestReportData(ga_profile_id,array('hour'),array('pageviews','visits'),n
ull,null,date("Y-m-d"),date("Y-m-d"));
        foreach($ga->getResults() as $result):
                $oneHour = $result->getVisits();
        endforeach;

        $ga->requestReportData(ga_profile_id,array('browser'),array('pageviews','visits'),null,null,date("Y-m-d", strtotime("-1 weeks")),date("Y-m-d"));
        $lastWeek = $ga->getVisits();

        $ga->requestReportData(ga_profile_id,array('browser'),array('pageviews','visits'),null,null,date("Y-m-d", strtotime("-1 months")),date("Y-m-d"));
        $lastMonth = $ga->getVisits();

        $ga->requestReportData(ga_profile_id,array('browser'),array('pageviews','visits'),null,null,date("Y-m-d", strtotime("-1 years")),date("Y-m-d"));
//        foreach($ga->getResults() as $result){
//            echo $lastYear = $result->getVisits().'</br>';
//        }
        $lastYear = $ga->getVisits();

        $ga->requestReportData(ga_profile_id,array('browser'),array('pageviews','visits'));
//        foreach($ga->getResults() as $result){
//            echo $totalVisit = $result->getVisits().'</br>';
//        }
        $totalVisit = $ga->getVisits();

Original issue reported on code.google.com by camlinf...@gmail.com on 8 Nov 2011 at 2:40