Filter based on visit duration

306 views
Skip to first unread message

watt

unread,
Jul 20, 2009, 4:30:21 PM7/20/09
to google-analytics-api - GA Data Export API
Hi!

I was trying to filter the datafeed the api returns based on visits
that lasted more than 180 s and I couldn't find the corresponding
dimension in the reference.
There is one for the visit depth in pages ga:pageDepth but not one
for the duration in seconds.

Anyone knows how I can do this?

Cheers,

Andrés

Nick

unread,
Jul 20, 2009, 4:49:07 PM7/20/09
to google-analytics-api - GA Data Export API
Hi,

It's a metric, ga:timeOnSite.
The dimensions return data similar to a histogram.

Try this : ga:timeOnSite>180;ga:timeOnSite<300

-Nick

andres

unread,
Jul 21, 2009, 5:22:44 AM7/21/09
to google-analytics-api - GA Data Export API
Thanks Nick,

I'll try this. But I can't help think that there is something strange
here. In GA GUI this is actually a dimension both for the reports
interface where as you mentioned you have a histogram for the visit
duration and also for the advanced segmentation where you have the
visit duration dimension to filter on.

The fact that as a metric in GA API feeds timeOnSite returns the sum
of all visits durations for the aggregate and for each line on the
report kind of introduces a different logic for the filter applied to
this particular metric. Don't you think so?

Cheers,

Andrés

Nick

unread,
Jul 21, 2009, 1:16:40 PM7/21/09
to google-analytics-api - GA Data Export API
Sorry I misread your initial request.

To go back a step, currently there is no visitDuration dimensions like
pageDepth. This is an open feature request. Although once you have
this, it will only be able to be combined with a very limited amount
of data, like visits.

Requesting timeOnSite returns the total time for example total time
spend by people from Google.
Filtering by timeOnSite returns a subset of data across all visits.
(ie total time spent for each entry returned)

If you want to select a subset of visits, and get all the metrics
associated with those visits, then you'll need advanced segmentation,
which is currently not avaliable through the API and an open feature
request.

Hope this clears things up,
-Nick

andres

unread,
Jul 21, 2009, 3:59:51 PM7/21/09
to google-analytics-api - GA Data Export API
Cheers,

That's what I thought. Keep the good job!
Reply all
Reply to author
Forward
0 new messages