This is the data I get from google api explorer:
"rows": [ [ { "conversionPathValue": [ { "interactionType": "CLICK", "nodeValue": "(not set)" } ] }, { "primitiveValue": "6" }, { "primitiveValue": "4.0" }
See Screenshot from google api explorer 1
This is the successful api call using PHP dumping one of the result row
array(425) { [0] => class Google_Service_Analytics_McfDataRows#612 (7) { protected $collection_key => string(19) "conversionPathValue" protected $conversionPathValueType => string(55) "Google_Service_Analytics_McfDataRowsConversionPathValue" protected $conversionPathValueDataType => string(5) "array" public $primitiveValue => NULL protected $internal_gapi_mappings => array(0) { } protected $modelData => array(3) { [0] => array(1) { ... } 1 => array(1) { ... } 2 => array(1) { ... } } protected $processed => array(0) { } }
See Screenshot 2
This is my php script dumping conversionPathValue and primitiveValue but returns null
$options = array( 'dimensions' => 'mcf:basicChannelGroupingPath' ); $metrics='mcf:totalConversions,mcf:totalConversionValue'; $q=$this->analytics_svc->data_mcf->>get('ga:'.$profile,$from,$to,$metrics,$options); //echo var_dump($q); if($q && isset($q->rows)){ $d=$q->getRows(); foreach($d as $v){ echo var_dump($v->getConversionPathValue()); echo var_dump($v->getPrimitiveValue()); break; } return []; }
Calling getConversionPathValue() and getPrimitiveValue() return nothing.