Tracking Outbound Clicks With Google Analytics

By Angsuman Chakraborty, Gaea News Network
Friday, November 18, 2005

This piece of JavaScript assigns a pageview to any click on a link - the pageview is attributed to the filename you specify.

For example, to log every click on a particular link to www.example.com as a pageview for “/outgoing/example_com” you would add the following attribute to the link’s <a> tag:

<a href="https://www.example.com" onClick="javascript:urchinTracker (’/outgoing/example_com’);">

It is a good idea to log all of your outbound links into a logical directory structure as shown in the example. This way, you will be able to easily identify what pages visitors clicked on to leave your site.

This piece of gem was hidden here.

Discussion
November 22, 2005: 11:57 am

[...] Reports Sony DRM Rootkit violating several open source licenses, lists Christmas wish from Google AdSense, provides tips on Google Analytics and simplifies SimpleXML for PHP developers. [...]

November 22, 2005: 8:35 am

[...] Reports Sony DRM Rootkit violating several open source licenses, lists Christmas wish from Google AdSense, provides tips on Google Analytics and simplifies SimpleXML for PHP developers. [...]

November 22, 2005: 8:27 am

[...] Reports Sony DRM Rootkit violating several open source licenses, lists Christmas wish from Google AdSense, provides tips on Google Analytics and simplifies SimpleXML for PHP developers. [...]

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :