How do I make each page load a specific javascript file?

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

Any ideas?

thanks

+1


a source to share


3 answers


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



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

+1


a source


Hmm, it looks like you are looking for .



+3


a source


It depends on how you create your website, but most people do it by adding a link to their templates, layouts, master pages, or whatever term is used in your development platform.

You don't want to track every page , for example, pages returning data like JSON or XML should not interfere. This is why it's better to have explicit control over which pages add analytic javascript to them.

0


a source







All Articles