If you want to get the global bounce rate in the last 30 days (default), here's how to do it. Very simple as soon as you know it.
//Check Bounce Rate for the last 30 days $ga = new gapi(ga_email, ga_password); $ga->requestReportData(145141242, NULL ,array('bounces', 'visits')); $data = round(($ga->getBounces() / $ga->getVisits()) * 100) . "%";
Please note that there is an error in the GAPI, they mention the measurement parameter optional (2nd parameter), but this is not so. You should open the gapi.class.php file and patch line 128 as follows:
//Patch bug to make 2nd parameter optional if( !empty($dimensions) ) { $parameters['dimensions'] = 'ga:'.$dimensions; } else { $parameters['dimensions'] = ''; }
Etienne Dupuis
source share