views:

184

answers:

3

I've created a pretty basic system here at work that does what Google analytics does (extremely simplistic in comparison) and it works quite well, but like Google Analytics it requires each page to reference a JavaScript file. Is there any way to make all of our pages that are served from IIS reference this Javascript file? I would like to capture these stats for every page.

Any ideas?

Thanks

A: 

This depends on how you build your web site, but most people do this by adding the reference to their templates, layouts, master pages, or whatever term is used in your development platform.

You don't want every page tracked, e.g., pages returning data such as JSON or XML should not be meddled with. This is why it is better to have explicit control over which pages get the analytics javascript added to them.

RedFilter
The most recent applications we've created all use a standard master page, but we have hundreds of independent legacy applications in a variety or languages, so I'd like it if there were something that could just put the referenced into the html that IIS serves....
Max Schmeling
+1  A: 

If you're dealing with static HTML files your best bet seems to be this previous question.

If you have an ASP site going, and you already have a header or layout file, I'd recommend putting it in there.

Parrots
+3  A: 

Hmm, it looks like you are looking for this.

RichardOD
That looks nice but we're using IIS 6. +1 for the good response though
Max Schmeling
Ah, it is probably cheaper to upgrade to IIS 7 than do it a more complex way. Also IIS 7 has a lot of advantages over IIS 6.
RichardOD