1
Could someone help me mount a search? in the google API?
1) The original and that works, and returns me how many sessions were made in that period, is the same as in 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 pick up the "KEY WORDS" (ga:keyword) as in the example that works by analyitics panel...
that is, in this example I have a "Metric" + "Dimension" that work!! and bring me all the Keywords!!
3) SOON THE QUESTION, what would the same search look like in gapi + php? like this?
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 error message saying that the "metric is unknown"
I made several unsuccessful combinations and did not find an example of how to "write" this search.
Could you add an explanation to your answer? It is always good to have an explanation about the modifications so that everyone can better understand what is being done
– RodrigoBorth