views:

77

answers:

3

I'm trying to use Google Analytics API to query internal searches that happen on my site.

I'd like to be able to query the keywords and the number of times that keyword was used in internal search, based on URL of a page on the site. The idea is to find out which keywords direct the user to a particular page.

Does anyone know which dimensions and metrics must use to query that information?

+1  A: 

The information you are talking about is in the "Site Search Terms" Report.

First, you need to set up Site Search. This is straightforward. A step-by-step explanation is on this GA Help Page.

Once you've done that, you just need to know how to access the Report.

  1. From the first page after GA login, select a Profile from the "View Reports" menu in the upper left-hand corner of the page

  2. On the left-hand side of the page (in the margin) click "Content" (the fourth item in the list of Dashboard pages) which will expand the items subsumed under the Content section

  3. "Site Search" will now appear in the margin below "Content"

  4. Click "Site Search"; the Report will have three tabs: (i) Site Search Usage; (ii) Goal Conversion; and (iii) Ecommerce. Obviously, most of the information you are interested in is in the first tab.

doug
+1  A: 

Once the search tracking is set up as per doug's answer, the dimension is ga:searchKeyword, and the metric you need is ga:searchUniques (and you probably want to sort by -ga:searchUniques). I've checked this against the GA web report & it matches up - the documentation in the GA API Query Explorer isn't really clear on what the ga:searchUniques really counts.

Jamie
good, concise description, +1 from me.
doug
I have setup the Search Tracking. Its just that there is no clear way to filter the data by a URL to find used keywords for it.
Am
A: 

In this page you can see all the dimensions and metrics available for Internal Search.

oriolfb