Method 2: Use Server-Side Include Files

This method of tagging website pages involves server-side include (SSI) files.

Server-side includes (SSI) are enabled by default on Internet Information Server (IIS) and Apache web servers. You can either configure the server to run SSI on all files with the extensions you use for your web pages (.htm, .html), or you may need to change your page extensions (to .stm, .shtm, and .shtml, for example).

To set up the include file and the include statements:

  1. Place the include file that contains the JavaScript tag in a location accessible to every page of your site.
  2. Place an include statement on all of your website pages. Be sure to use the correct file extensions. For example, if your include file is named and located in the mysite directory, you place the following include statement on your web pages:
    <!--#include virtual="/mysite/"-->