Tracking Referrers through API and update local DB

18 views
Skip to first unread message

YCBM

unread,
Nov 11, 2009, 1:18:16 AM11/11/09
to google-analytics-api - GA Data Export API
Hi All,

New to this group. I've been looking for a way to track referrers
more reliably than using PHP or JS as not all browsers send the
referrer information.

One idea was to query the Google Analytics API once every 12 hours for
a list of referrers to my site so that I can update some DB tables on
my end.

Is this possible? Has anyone tried doing this -- example code or URLs
with more info greatly appreciated.

Best,
Cent

Nick

unread,
Nov 11, 2009, 1:56:01 AM11/11/09
to google-analytics-api - GA Data Export API
Hi,

Yes, Google Analytics track referrals to your site. Through our API
you can access these referrals on a regular basis to update a
database. A bunch of companies do this today and do all sorts of fun
stuff with the data. If you have a GA account, there's an explorer
tool you can use to see what data we expose:
http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html


If it would be helpful, I also have a Java example that pulls pages
and visits for a date range and updates a database through JDBC. You
can update the fields with your own data and configure the output as a
cron job to automate this task on a regular basis.

-Nick

JezC

unread,
Nov 12, 2009, 3:40:57 AM11/12/09
to google-analytics-api - GA Data Export API
How do you think that Google collects the referrer information?
AFAICS. it uses the "referer_info" field, the one that isn't reliably
completed... IOW, no extra information appears to be used.

The main extra source of information that Google could use would be
for clicks from Google advertising - e.g. content network, where the
gclid is potentially a reference to a database that only Google has
access to, which should directly or indirectly allow access to the
information about the publisher that showed the page (needed so that
AdSense payment can be made).

However, in testing that I've done, I can't see that Google uses that
data. It appears to use the referer_info. IOW, no more information
about the referrer than you can now get.

Cheers, JeremyC.

Nick

unread,
Nov 16, 2009, 8:02:25 PM11/16/09
to google-analytics-api - GA Data Export API
Hi,

Our tracking code uses JavaScript to extract the Doms
document.referrer property.

-Nick

JezC

unread,
Nov 23, 2009, 4:41:43 AM11/23/09
to google-analytics-api - GA Data Export API
Thanks for the confirmation, Nick.

So, the Document Object Model entity is derived from the same browser
volunteered information as populates the "referer" header, referenced
by RFC 2616. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Your reply means that Google Analytics does not reveal more about a
source than any other web analytics package can do.

There is potential within Google to do more, at least for AdWords and
DoubleClick clicks. The unique tags added by, for example, AdWords
AutoTagging potentially could carry the referring source of the
publisher, which would help advertisers to tune in, or out, specific
publishers more easily. This would be a unique win for Google
Analytics; no-one other than Google has that data.

Of course, if Google *did* use the extra info, I'd immediately
complain that Google was now playing vendor lock-in games ;) There's
no winning with some people, eh?

Cheers, JeremyC.

Nick

unread,
Nov 23, 2009, 1:58:18 PM11/23/09
to google-analytics-api - GA Data Export API
Hi,

You might want to read up on AutoTagging:
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55590

Enabling this feature in AdWords and linking accounts allows the
following dimensions and metrics to be derived:

ga:adGroup
ga:adSlot
ga:adSlotPosition

ga:adCost
ga:adClicks
ga:CPC
ga:CPM
ga:CTR
ga:impressions

-Nick

On Nov 23, 1:41 am, JezC wrote:
> Thanks for the confirmation, Nick.
>
> So, the Document Object Model entity is derived from the same browser
> volunteered information as populates the "referer" header, referenced
> by RFC 2616.http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Reply all
Reply to author
Forward
0 new messages