IIS Express

Web development on the Microsoft platform has always had its hurdles. With Windows XP, your development environment would use IIS 5 where as the server that would host the production site would be IIS 6. Additionally, there was the issue where we were limited to a single website running on that machine (this was a pain when working on multiple projects at the same time).

Microsoft’s virtual web server that would get kicked off by Visual Studi0 (Casini) alleviated some of the hardships by allowing each one of your web projects to run on an individual site. With the release of IIS 7, and particularly the rewrite rules that they provided, we ran into another issue where our production environments supported rest-full, SEO friendly URLs but the virtual web servers initiated by Visual Studio would not be able to process the URLs.

Recently, Microsoft addressed many of these issue with IIS Express. Scott Guthrie blogs about this new tool here: http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx

Custom Event Tracking with Google Analytics

I have been researching a method for tracking clicks to external sites from my site. Google Analytics’s custom event tracking is a nice solution. Here is a link for the asynchronous event tracking scripts for Google Analytics: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html#Anatomy. Keep in mind that to work with this code, you need the 3rd generation of Google Analytics scripts on your site. If you are using urchin.js or ga.js then you need to update your scripts.

Here is an example implementation:

<script type="text/javascript">
function LogLinkClick( linkId ){

_gaq.push(['_trackEvent', 'Outgoing Links', 'Click', 'Link ' + linkId]);

alert( "Clicked 'Link " + linkId + "'" );

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Hello World!<br /><br /><br />

<a href='javascript: LogLinkClick(1);'>Link 1 </a><br />
<a href='javascript: LogLinkClick(3);'>Link 3 </a><br />
<a href='javascript: LogLinkClick(5);'>Link 5 </a><br />
<a href='javascript: LogLinkClick(7);'>Link 7 </a><br />

You need to dig around the Google Analytics dashboard to find the event tracking reports.

  1. When you access the main page for Google Analytics, click the View Report link for the profilefor which you are tracking the events.
  2. On the left navigation, select Content
  3. Under Content, select Event Tracking and Categories
Google Analytics has released a beta of their new user interface. To view your custom events in this new user interface, expand the Content tab on the left navigation then Events and Overview.