简体   繁体   English

来自Google Analytics的实时访问者。 怎么弄?

[英]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? 有没有办法使用gapi (首选)从Google Analytics中检索实时访问者?

I tried to pass a date range like: 我试图传递一个日期范围,如:

begin: 2012-12-12 09:49:04 end: 2012-12-12 09:49:05 开始时间:2012-12-12 09:49:04结束: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. 谷歌现在推出了一个实时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 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. api尚未提供对实时数据的访问。 See the following: 请参阅以下内容:

Access to Real Time data 访问实时数据

Scraping Real Time Visitors from Google Analytics 从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/ 目前获取它的唯一方法是在Google Analytics网络界面中查看它: https//www.google.com/analytics/web/

Embed API - Third Party Visualizations 嵌入API - 第三方可视化

在此输入图像描述

The Embed API make it easy to query data and display it in a Google Chart. Embed API可以轻松查询数据并将其显示在Google图表中。 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. 此示例使用Chart.js可视化库。

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. Embed API构建于Google API客户端库之上,这意味着您不仅可以访问报告API,还可以访问所有内容。

In addition to showing Chart.js visualizations, this example uses the underlying client library to query data from the Real Time Reporting API. 除了显示Chart.js可视化之外,此示例还使用基础客户端库从Real Time Reporting API查询数据。

You can take a look here: https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/ 你可以看看这里: 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: 如果您不想等待公开发布API并且不需要从第三方帐户提取数据,那么我在此处对Analytics仪表板使用的API进行反向工程:

https://stackoverflow.com/a/18945515/900747 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. 正如你在答案中看到的那样,它几乎不是一个稳定的API,但它应该提供你需要的一切,假设这是供个人使用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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