2

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

4

1 回答 1

1

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

关于您关于跟踪后退/前进导航运动的问题,作为一个单独的问题提出可能会很好。如果可能的话,您可能必须以某种方式使用ga.js包在您的页面上添加一些自定义 javascript,但我不是如何做到这一点的专家。

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

于 2013-05-15T14:03:03.823 回答