getting paid and organic keywords from API

971 views
Skip to first unread message

Mark

unread,
Apr 12, 2012, 4:59:39 PM4/12/12
to google-analytics...@googlegroups.com
HI there,

on the GA Web UI (Old Version),  I can go to Traffic Sources -> Keywords to see my keywords.   I can click on the 'non-paid', 'total' and 'paid' links to give me organic keywords, paid or both.

using the GA API, when I do metric: ga:visits and dimension: ga:keyword, I seem to get only the results of the 'total' link (both paid and organic) keywords.  

So is there any way to get a list of paid keywords and a list of organic keywords from the API?  If so, what are the parameters to achieve this?  Thanks!

-Mark

P.S.

Incidentally, not sure if this info is useful or not, but the values I get from the UI for paid keywords is the same as when I click on Adwords (in the GA Web UI) - > Keywords


Nick

unread,
Apr 12, 2012, 5:04:39 PM4/12/12
to google-analytics...@googlegroups.com

Mark

unread,
Apr 13, 2012, 6:36:49 PM4/13/12
to google-analytics...@googlegroups.com
Ah, great.  Thanks Nick for pointing me there.  

Here's the solution.

Keywords for paid:

metrics: ga:visits
dimensions: ga:keyword,ga:medium
filters: ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cpv,ga:medium==ppc
sort:  -ga:visits

Keywords for organic:

metrics: ga:visits
dimensions: ga:keyword,ga:medium
filters:  ga:medium==organic
sort:  -ga:visits


You actually don't need the ga:medium dimension in either query for it to work, but it highlights the concept more clearly

Stefan

unread,
Feb 8, 2013, 4:42:19 AM2/8/13
to google-analytics...@googlegroups.com
I get more keywords from the API than the UI when I use this code for organic keywords.

Any suggestions why?

-stefan
Reply all
Reply to author
Forward
0 new messages