简体   繁体   中英

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

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?

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

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/

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM