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
a source to share
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.
a source to share
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.
a source to share