[Yanel-dev] Google analytics exit link onclick problem

Guillaume Déflache guillaume.deflache at wyona.com
Mon Apr 26 19:33:34 CEST 2010


Hi!

Michael Wechner schrieb:
> Hi
> 
> I have refactored the Google analytics code slightly and have noticed 
> that it currently does not allow re onlick() to differentiate
> between external and internal links starting with http or https, e.g. 
> let's assume we have have a page
> 
> http://localhost:8080/yanel/foo/bar.html
> 
> which contains the following links
> 
> http://localhost:8080/yanel/foo/bob.html
> http://www.nyt.com/yanel/foo/bob.html
> 
> then both links will be sent to Google analytics as
> 
> /yanel/foo/bob.html
> 
> because the method/function Yanel_requestURIFromFQURL within
> 
> src/webapp/htdocs/Google-Analytics/GA.xslt
> 
> is cuttinng off the protocol and the hostname, because AFAIK Google does 
> not
> allow protocol and hostname to be sent.

I found why I excluded full URLs original: the documentation for the 
'_trackPageview' method at 
http://code.google.com/intl/en/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._trackPageview 
says to "use a beginning slash (/) to indicate the page URL."
Also see http://bugzilla.wyona.com/cgi-bin/bugzilla/show_bug.cgi?id=7169 
for the initial design ideas.


> Any idea how to improve this, because it would actually be nice to 
> analyze exit links?
> 
> (in particular re goals/funnels: 
> http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55515) 

Google recommends using event tracking, cf. 
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527


Google also documents how to use event tracking also for downloads, 
which may be less of a hack than the above method, and can apparently do 
more: in 
http://code.google.com/intl/en/apis/analytics/docs/tracking/eventTrackerGuide.html 
search for "download"

HTH,
    Guillaume


More information about the Yanel-development mailing list