Google Analytics Filter ver. 1.2

This is a Java servlet filter (as per Servlet API 2.3). UrchinFilter lets you add dynamically Google Analytics tracking code to the requested pages.

How to use it:

a) download urchinflt.jar and save it in WEB-INF/lib

b) describe this filter in web.xml. There is an initial parameter code describes your Google Analytics code (it is some like this UA-XXXXXX-X):


c) describe a mapping for this filter in web.xml


in this case filter will be on for the each .jsp file

And now when you invoke any .jsp page: http://your_host/your_page.jsp UrchinFilter will add Google Analytics tracking code:

<script src="" type="text/javascript">
<script type="text/javascript">
_uacct = "UA-XXXXXX-X";

at the end of your files.

    For downloading:   urchinflt.jar

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.


Also in JSOS: