Retrieving the search engine domain name

9 views
Skip to first unread message

Andy Nichols

unread,
Nov 18, 2009, 9:32:26 AM11/18/09
to google-analytics-api - GA Data Export API
I'm trying to get (from the API) the visit counts and goal counts for
all keyword/search engine combinations.

My metrics are fine using:
dataquery.Metrics = "ga:visits,ga:goalCompletionsAll";

And the filter works fine as:
dataquery.Filters = "ga:keyword!=(not set);ga:keyword!=(content
targeting)";

But I can't get the search engine domain name. I've tried the
following:
dataquery.Dimensions = "ga:keyword,ga:referralPath";
dataquery.Dimensions = "ga:keyword,ga:source";

For ga:referralPath it always states "(not set)"
For ga:source I get the search engine, but not at the level of
granularity I require. I would like "google.com", "google.co.uk", etc.
However, it just returns "google".

How can I get the full domain name for search requests?

Nick

unread,
Nov 20, 2009, 1:35:52 PM11/20/09
to google-analytics-api - GA Data Export API
Hi,

You can get the full referral URL through Google Analytics by using a
profile level filter to extract the domain from the referral URI field
and insert it into the source field at the time when the data is
processed. That way it will be made available through the ga:source
dimension via the API.

Here's an article I found that describes the general process:
http://trungso.com/blog-google/get-full-url-referrals-and-organic-sources-google-analytics.html

The author outputs the result to the User Defined field, but you can
easily overwrite ga:source fields as well.

Good Luck,
-Nick
Reply all
Reply to author
Forward
0 new messages