Forum:Stats Counter Implementation

Hello, I'd like to implement a stats counter on my wiki, I saw on Runescape wiki that they implemented it in the sidebar. I can do that copying their code, but I'd like also to implement the counter, which is an html/js script code, in the home page (simply add the code doesn't work) otherwise it will be ignored in the stats. So i need a simple javascript code which add the code to the page, or even better add the code in a certain position (indicated, for example by an element with a certain class like div class="counter"). Alternately a script which will add the code to the header or the footer (like those clocks scripts).