Forum Moderators: DixonJones
The 'smallest' tracking code is none - and relying upon your server's logs to capture complete information.
For Apache, thats combined log format; for IIS, you pick the fields you need or just click all of themh; for other servers, you'll have to check the manual.
The server's won't capture client information other than the client's browser name. If you want screen width and other extra information, you'll have to resort to javascript and tracking images or tracking script calls.
Not sure why you are wanting "smallest code" - but if it is to keep the page code content heavy, then take the tracking script and put it into its own .js file. The one we use does this by default, but with a little thought you could cut the code more (not least by deleting comment tags).
using a .js script means that it takes fractionally longer to load on the first page but then (someone will tell me if I am wrong) it stays resident in memery clientside so is quick thereafter.