First, the code samples, at least PHP and ASP.NET ones, look as if written by someone who didn't cared much about code quality.
Huge string concatenations in C# instead of using StringBuilder, unused library references, unused variables... And the PHP version, probably to support PHP 4 was also quite crappy and with globals.
Overall I could reduce PHP code to 1/3 and ASP.NET code to 1/2 of their original size (also optimized some things to my specific needs). So i t is worth to spend a bit of time in cleaning the samples if you plan to use them.
And second, once I had everything in place and working, I noticed that the language was not being sent to my stats. All of them were reflected in Google Analytics as "(unset)". While not critical, I like to know from where my visits come from, so I digged a bit to see how this works in the normal GA. The solution is quite easy, just append this to your google analytics tracking pixel call:
'&utmul=' . $_SERVER["HTTP_ACCEPT_LANGUAGE"];
For PHP and C# respectively.
Tip: most headers will have more stuff in that header (for example "es-ES;q=0.7"), so you might want to do some cleaning before, as Google Analytics won't do it.