Use Google Analytics . Its a small piece of Javascript code that is inserted before the tag. It is based on Urchin analytics tracking software, which Google bought. They have been doing this for a long time.
As long as your site links to a fully functional domain name, Google Analytics can track what you need. It also gained more flexibility with a filtering mechanism (let you rewrite URLs based on query string parameters, etc.)
LOTS functionality and well-designed, as well as a good API, if you need to track events other than clicks.
source share