Limit keywords for day in a Google Analytics API request

44 views
Skip to first unread message

Luciano

unread,
Dec 7, 2011, 9:12:10 AM12/7/11
to google-analytics-api - GA Data Export API, kr...@citynews.it
I just asked the same question on stack overflow (
http://stackoverflow.com/questions/8359823/limit-keywords-for-day-in-a-google-analytics-api-request
) but I had no luck... I think this can be the right place to ask the
question... (finger crossed!)

I'd like to know if there's a way to get the top 5 keywords by
grouping them by days of the current month.

I'd like to receive a dataset like the following as result. Supposing
today is 4 of December i want to retrieve data for days from 1 to 4 of
December, limiting the number of keywords for day to 5:

Day Keyword Visits
----------------------
01 keyword1 703
01 keyword2 688
01 keyword3 115
02 keyword1 109
02 keyword2 66
02 keyword3 53
02 keyword4 40
02 keyword5 23
03 keyword1 23
03 keyword2 19
03 keyword3 17
04 keyword1 14
04 keyword2 14


What i've currently done is setting the following parameters:

Dimensions: ga:day,ga:keyword
Metrics: ga:visits
Filters: ga:medium==organic;ga:keyword!=(not provided)
Sort: ga:day,-ga:visits,ga:keyword

Now i just need a method to limit the number of keywords for day (if
possible).

Nick

unread,
Dec 7, 2011, 12:42:30 PM12/7/11
to google-analytics-api - GA Data Export API
I wrote 2 articles on this topic: http://code.google.com/apis/analytics/docs/articles/gdataDataOverTime.html

Today you need to do this in multiple queries.

1 query to find the top keywords in a date range.

Then you can either create a single query for each keyword (using
filters)

Or if you have a small number of keyword, like 5,
You can use the ga:date and filters and get everything in 1 query.
-Nick


On Dec 7, 6:12 am, Luciano <loigi...@gmail.com> wrote:
> I just asked the same question on stack overflow (http://stackoverflow.com/questions/8359823/limit-keywords-for-day-in-...

Reply all
Reply to author
Forward
0 new messages