如何从Google Analytics(分析)GAPI API获取“访问者流量”数据? [英] How to get “Visitors Flow” data from Google Analytics GAPI API?

查看:154
本文介绍了如何从Google Analytics(分析)GAPI API获取“访问者流量”数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Analytics(分析)中,有一个非常好的访客流量页面,它清楚地包含并跟踪访问者在网站上采取的路径。是否有可能从API获取数据?我知道您可以使用自定义变量为用户提供唯一的ID,而且我已经这样做了,但即时可以使用已经收集的数据,而无需自定义变量。我现在有以下几种:

  $ ga-> requestReportData(56786432,array('networkLocation','date ','hour','nextPagePath','previousPagePath'),数组('avgTimeOnSite','visits','pageviews'),array(' -  date','-hour'),null,null,null,1 ,100); 

这让我访问带有日期和小时的会话,我认为这是一个开始,但是如何从这里继续?是否有可能?



编辑
我现在添加了nextPagePath和previousPagePath作为新的尺寸和综合浏览量。这为访问者浏览网站提供了一些路径。如果访问者进入路径 A-> B-> C-> exit ,则会得到结果:

 综合浏览量:1上一页:(entrence)下一页::A 
浏览量:1上一页:B下一页::C
浏览量:1上一页:A下一页::B

以上结果的确是正确的,但如果访问者在网站上多次从A-> B和A- > C多次无法跟踪他何时去B,何时去C

 综合浏览量:1以前:(entrence)下一个::A 
浏览量:2上一个:A下一个::C
浏览量:5上一个:A下一个::B
浏览量:2上一个:C下一个::A
pageviews4 previous:B next::C

如果可能我需要得到结果对于访问者按正确顺序访问的每个新页面。



我已经看到了这个问题,但它没有让我更接近我的答案:获取Google Analytics访问者流量来自API的数据

解决方案

我目前正面临一个类似的问题,使用Android SDK的和我碰到你的问题和这是一个。您当然可以从Google Analytics报告API中获取流量数据并对其进行任何类型的分析。面临的挑战是,您可能必须使用核心报告库来访问所有结果。



关于跟踪后退/前进导航移动的问题,作为单独的问题。如果可能的话,您可能必须使用 ga在您的网页上添加一些自定义JavaScript .js 包,但我不是如何做到这一点的专家。



注意:我不是律师,但我认为可能违反 Google Analytics服务条款,尝试跟踪您的个人用户应用。如果我错了,那将是令人愉快的,我想开始自己做!

In Google Analytics there is a verry nice "visitor flow" page that clearly contains and keeps track of what path a visitor has taken on the site. Is it possible to get that data from the API? I know that you can use "custom variables" to give the users a unique ID and i do that already but what im after is to be able to use the data already collected without custom variables. I have got the following at the moment:

$ga->requestReportData(56786432, array('networkLocation', 'date', 'hour', 'nextPagePath', 'previousPagePath'), array('avgTimeOnSite', 'visits','pageviews'), array('-date', '-hour'), null, null, null, 1, 100);

This gives me visit "sessions" with date and hour and i think this is a start but how to continue from here? Is it possible?

EDIT I have now added nextPagePath and previousPagePath as new dimentions and pageviews as a metric. This gives somewhat of the path that the visitor went through the site. If the visitor went the path A->B->C->exit this gives me the result:

pageviews:1 previous:(entrence) next: :A
pageviews:1 previous:B next: :C
pageviews:1 previous:A next: :B

The above result is indeed correct but if the visitor went backwards and forwards on the site multiple times crossing from A->B and A->C multiple times its not possible for me to track when he went to B and when he went to C

pageviews:1 previous:(entrence) next: :A
pageviews:2 previous:A next: :C
pageviews:5 previous:A next: :B
pageviews:2 previous:C next: :A
pageviews4 previous:B next: :C

If its possible i need to get a result for each new page the visitor got to in the right order.

I saw this question already but it didnt get me any closer to my answer: Get Google Analytics "Visitors Flow" data from API

解决方案

I'm currently facing a similar problem using the Android SDK and I ran across both your question and this one. You can certainly get the flow data out of the Google Analytics Reporting API and run any kind of analysis on it you want. The challenge is that you will likely have to paginate through the results using one of the core reporting libraries to access all of the results.

Regarding your question about tracking the back/forward navigation movements, that might be good to ask as a separate question. If its possible, you will probably have to add some custom javascript on your page using the ga.js package somehow, but I'm not an expert on how to do that.

Note: I'm no lawyer, but I think it may be against the Google Analytics Terms of Service to try and track individual users in your application. If I am wrong, that would be delightful and I would like to start doing it myself!

这篇关于如何从Google Analytics(分析)GAPI API获取“访问者流量”数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆