Real time visitors from Google Analytics. How to get it?

▼魔方 西西 提交于 2019-12-23 14:21:25

问题


Is there any way using gapi (preferable) to retrieve the real time visitors from Google Analytics?

I tried to pass a date range like:

begin: 2012-12-12 09:49:04 end: 2012-12-12 09:49:05

but it didn't work.

I did a research and couldn't find a solution yet.

Someone can help me?


回答1:


Access to the real-time data is not yet available through the api. See the following:

Access to Real Time data

Scraping Real Time Visitors from Google Analytics

The only way to get it currently is to look at it in the Google Analytics web interface: https://www.google.com/analytics/web/




回答2:


Google has now launched a real time API. It is only in beta however you can sign up and should be available to everyone later.

http://analytics.blogspot.co.uk/2013/08/google-analytics-launches-real-time-api.html




回答3:


Embed API - Third Party Visualizations

The Embed API make it easy to query data and display it in a Google Chart. But it also allows you to access the raw data so you can display it however you want. This example uses the Chart.js visualization library.

The Embed API is built on top of the Google APIs client library, which means you don't just get access to the reporting API, you get access to everything.

In addition to showing Chart.js visualizations, this example uses the underlying client library to query data from the Real Time Reporting API.

You can take a look here: https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/




回答4:


If you don't want to wait for the API to be publicly released and don't need to pull the data from third-party accounts then I reverse-engineered the API used by the Analytics dashboard here:

https://stackoverflow.com/a/18945515/900747

As you can see in the answer it's hardly a stable API but it should provide everything you need, assuming that this is for personal use.



来源:https://stackoverflow.com/questions/13839430/real-time-visitors-from-google-analytics-how-to-get-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!