Traffic Referrals Drilldown

78 views
Skip to first unread message

Phill Clark

unread,
Nov 21, 2011, 3:49:10 PM11/21/11
to google-analytics-api - GA Data Export API
In the GA web portal I can run a Referral Traffic report which gives
me all my top level referral domains - if I click on one then I get a
drilldown into that specific domain and can see paths of where traffic
came from.

Below is a sample URL for one of these reports:
https://www.google.com/analytics/web/#report/trafficsources-referrals/a711594w50405731p51xxxxxx/?_.date00=20111001&_.date01=20111031&_r.drilldown=analytics.source:domain.com/

I'm trying to do the same thing in the GA Data Export API - I can get
the top level domain data without an issue but am struggling to get
the drilldown level data - can anyone advise if it's possible with the
API and if so how?

Cheers.

Alex Brambila

unread,
Nov 21, 2011, 5:32:38 PM11/21/11
to google-analytics...@googlegroups.com
I don't believe it will do that automatically.  You'd have to write code to do that, i.e. query top level, load it into some table with link to another query for the drill down.

Phill Clark

unread,
Nov 22, 2011, 4:29:15 AM11/22/11
to google-analytics-api - GA Data Export API
Thanks for the response. I'm happy to write a sub-query but am
struggling to find how to filter it to beyond the top level domain on
the API - I can get the figures for the TLD so it's just that but not
extensions within it....

Nick

unread,
Nov 23, 2011, 1:06:27 PM11/23/11
to google-analytics-api - GA Data Export API
The way it works is you run 1 query for all the sources where
medium==referral.

When you click a source, that value becomes gets added to the filer:
medium==referral;source==value
and you query for ga:referralPath.

A simple way to do this in 1 request is to query for both source and
referralPath at the same time.

-Nick


On Nov 21, 12:49 pm, Phill Clark <phill.cl...@gmgradio.com> wrote:
> In the GA web portal I can run a Referral Traffic report which gives
> me all my top level referral domains - if I click on one then I get a
> drilldown into that specific domain and can see paths of where traffic
> came from.
>

> Below is a sample URL for one of these reports:https://www.google.com/analytics/web/#report/trafficsources-referrals...

Phill Clark

unread,
Nov 24, 2011, 4:28:57 PM11/24/11
to google-analytics-api - GA Data Export API
Thanks. I'm still only getting the same results though.

_https://www.google.com/analytics/feeds/data?ids=ga
%3Axxxxxxxx&dimensions=ga%3Asource&metrics=ga%3Apageviews%2Cga
%3Avisits&filters=ga%3Amedium%3D%3Dreferral%3Bga%3Asource%3D
%3Dbbc.co.uk&sort=-ga%3Avisits&start-date=2011-10-01&end-
date=2011-10-31&start-index=1&max-results=1000

I get the following result:

ga:source ga:pageviews ga:visits
--------- ------------ ---------
bbc.co.uk #### ####

What I'm trying to do is then go into the next level of data like I
can on the web interface. In there, if I click on the "bbc.co.uk" I
then get the drilldown of all the sub domains (eg. "/iplayer/console/
bbc_radio_two") and the relevent referral data. It's that element I'm
trying to do in the API to get all the directory level items & data
for a specified domain.

Hope that makes sense?

Nick

unread,
Nov 29, 2011, 9:13:57 PM11/29/11
to google-analytics-api - GA Data Export API
Right, to get the referral path information, you need to add the
ga:referralPath dimension to your query.

-Nick

Phill Clark

unread,
Nov 30, 2011, 3:57:43 AM11/30/11
to google-analytics-api - GA Data Export API
Nick - thank you so much - YOU ARE A LEGEND! Worked perfectly.
Reply all
Reply to author
Forward
0 new messages