Mais conteúdo relacionado Semelhante a Google Analytics Reporting API: Bebendo água direto da fonte (20) Google Analytics Reporting API: Bebendo água direto da fonte2. Como assim, API!?
Rotinas e padrões estabelecidos para a
utilização externa de funcionalidades e serviços
de um sistema.
5. e.g.
Mais:
http://www.google.com/analytics/apps/
7. Google Analytics APIs
Configuration Reporting
Management API Core Reporting API
Multi-Channel
Funnels Reporting
API
9. Reporting – Core Reporting API
Maior parte de core reports do Google
Analytics.
10. Reporting – MCF Reporting API
Dados de Multi-Channel Funnels de um usuário.
18. Contas
...
<script src="https://apis.google.com/js/client.js"></script>
...
<script>
function management_accounts() {
gapi.client.load('analytics', 'v3', make_management_api_accounts_call);
}
function make_management_api_accounts_call() {
gapi.client.analytics.management.accounts.list().execute(YOUR_HANDLER);
}
</script>
...
<button onclick="management_accounts();">Buscar Contas</button>
...
https://github.com/johannvivot/gauc2012
19. Web Properties
...
<script src="https://apis.google.com/js/client.js"></script>
...
<script>
function management_web_properties() {
gapi.client.load('analytics', 'v3', make_management_api_web_properties_call);
}
function make_management_api_web_properties_call() {
gapi.client.analytics.management.webproperties.list({
'accountId': ACCOUNT_ID
}).execute(YOUR_HANDLER);
}
</script>
...
<button onclick="management_web_properties();">Buscar Web Properties</button>
...
https://github.com/johannvivot/gauc2012
20. Perfis
...
<script src="https://apis.google.com/js/client.js"></script>
...
<script>
function management_profiles() {
gapi.client.load('analytics', 'v3', make_management_api_profiles_call);
}
function make_management_api_profiles_call() {
gapi.client.analytics.management.profiles.list({
'accountId': ACCOUNT_ID,
'webPropertyId': WEB_PROPERTY
}).execute(YOUR_HANDLER);
}
</script>
...
<button onclick="management_profiles();">Buscar Perfis</button>
...
https://github.com/johannvivot/gauc2012
21. Consulta
...
<script src="https://apis.google.com/js/client.js"></script>
...
<script>
function core_reports_visits() {
gapi.client.load('analytics', 'v3', make_core_reports_api_call);
}
function make_core_reports_api_call() {
gapi.client.analytics.data.ga.get({
'ids': TABLE_ID, // e.g. ga:xxxxxxx
'start-date': START_DATE,
'end-date': END_DATE,
'metrics': 'ga:visits', // METRICS
'dimensions': 'ga:source', // DIMENSIONS
'sort': '-ga:visits,ga:source', // SORT
'max-results': 10000 // MAX RESULTS
}).execute(YOUR_HANDLER);
}
</script>
...
<button onclick="core_reports_visits();">Buscar Visitas</button>
...
https://github.com/johannvivot/gauc2012
22. Guia
ids = string * max-results = integer
start-date = string * fields = string
end-date = string * prettyPrint = boolean
metrics = string * userIp = string
dimensions = string quotaUser = string
sort = string access_token = string
filters = string callback = string
segment = string key = string
start-index = integer
* Campos obrigatórios
26. Limites da API
Geral
50.000 requests por projeto por dia
10 queries por segundo por IP
Core Reporting API
10.000 requests por perfil por dia
10 requests concorrentes por perfil
27. Dica – Data Feed Query Explorer
http://ga-dev-tools.appspot.com/explorer/