php - How to add dimensions to Google analytics api requets -


the examples given google simple query request. however, when try add more parameters, throw errors , don't know how structure syntax.

this simple query request works:

 return $analytics->data_ga->get(   'ga:' . $viewid,   $startdate,   $enddate,   'ga:sessions' ); 

i need more information , i've used google's query explorer information don't know how structure php query. information want request ga:pageviews metric, ga:pagepath , ga:pagetitle dimensions , filter. fail @ adding second metric.

i have tried this:

return $analytics->data_ga->get(   'ga:' . $viewid,   $startdate,   $enddate,   'ga:sessions',   'ga:pageviews' ); 

simply adding doesn't work. can point me in correct direction?

dimensions need added option parms

//adding dimensions  $params = array('dimensions' => 'ga:usertype');  // requesting data   $data = $service->data_ga->get("ga:89798036", "2014-12-14", "2014-12-14", "ga:users,ga:sessions", $params );     

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -