I'm trying to extract data from my custom dimension and save to database.I tried this simple code.But I can't retrieve my custom data.I got this error "Unknown dimension:my custom dimension"
<?php
include_once(app_path().'/gapi.class.php');
$ga = new gapi('my email','my password');
$ga->requestReportData('my GA Id',array('my Custom dimension'),array('my custom metrics'));
foreach($ga->getResults() as $result)
{
echo $result;
}
?>
Does anyone have a solution to this problem?