Could anyone help me set up a search? in the google API?
1) The original and that works, and returns me how many sessions were done in that period, is the same as the google example:
function getResultsA(&$analytics, $profileId) {<br>
// Calls the Core Reporting API and queries for the number of sessions<br>
// for the last seven days.<br>
return $analytics->data_ga->get(<br>
'ga:' . $profileId,<br>
'7daysAgo',<br>
'today',<br>
'ga:sessions');<br>
}
2) I need to get the "KEY WORDS" (ga: keyword) as in the example that works through the analytics panel ...
That is, in this example I have a "metric" + "dimension" that works !! and bring me all the keywords !!
3) LOGO THE QUESTION, how would the same search in gapi + php look? so?
function getResultsA(&$analytics, $profileId) {<br>
// Calls the Core Reporting API and queries for the number of sessions<br>
// for the last seven days.<br>
return $analytics->data_ga->get(<br>
'ga:' . $profileId,<br>
'7daysAgo',<br>
'today',<br>
//'ga:sessions');<br>
'ga:sessions, ga:keyword, -ga:sessions');<br>
}
Being that I'm only getting an error message saying that "metric is unknown"
I made several unsuccessful combinations and did not find an example of how to "write" this search.