Forum:Hit counter

Is there a way to put a hit counter on a wiki with Monaco skin? Swa n nie §  ♣  ☼ 12:58, 8 July 2008 (UTC)
 * Just get Google Analytics. --LordTBT Talk! 21:29, 8 July 2008 (UTC)
 * And how does one incorporate Google Analytics into Wikia? &mdash;Al E. (talk) 12:23, 10 July 2008 (UTC)

the three penny hitcounter (that no longer seems to work)
' note april 2009 ... i cannot get this to work anymore. hits are no longer being counted apparently. i have no idea what is wrong. '

Here is a super simple cheap no-frills way to do a hit counter, on your wikia wiki, for the monaco "skin". (which happens to be the default skin, as of feb 2009)

I took this idea from http://www.wikia.com/wiki/User:Splarka/tricks " Poor Man's Hit Counter ", but modified it to try to make the instructions easier to follow and also so it will work with the monaco wikia skin.

Step 1. Get an account on a hit counter site.
Get an account on a free hitcounter site that works off of plain old image links, like http://www.hitslog.com.

Step 2. Get the URL for your hit counter image
The hit counter site will give you a url that links to an image that will act as your hit counter. You paste that url into your wikia and that generates hits on the hit counter site.

For example, for hitslog.com, you will be given a bunch of 'codes' after regsitration. The 'code' you need to get is the one they call the 'myspace' code (myspace restricts a lot of the html you can use, as does wikia). Now look into that code for a URL, and grab it.

The URL will look something like this: http://h2.hitslog.com/myspace/123456.png

But dont use 123456, use the number that hitslog.com gives you. 123456 is the kind of code an idiot would put on his luggage.

Step 3. Edit your Monaco.css file.
IE, go to http://yourwikia.wikia.com/wiki/MediaWiki:Monaco.css

(uhm.... replace 'yourwikia', above, with the name of your wiki)

Now, edit it, and put this in:

 background-image: url(http://h2.hitslog.com/myspace/123456.png); height: 1px; width: 1px; }
 * 1) accent_graphic2 {

...but you replace the url for hitslog, with the one that you got for your account on your hit logging website.

The result: This makes a tiny, tiny 1 pixel by 1 pixel image on the righthand side of your wikia, that loads whenever any page of your wikia is accessed and generates a hit on the hit counter website. I guess I could have figured out a better place to put this, but I didn't feel like delving into 18 levels of CSS and media wiki to try to figure out where to put it. Ideally it would be a ordinary hitcounter graphic at the bottom of the page, but i have no idea how Monaco could do that. Some other #accent_graphic or #footer or something that i dont know about.

Step 4. Activate your Mono.css file.
Believe it or not, Monaco.css is not actually Monaco. Monaco.css is for 'custom monaco', which you have to activate by going into your Special Pages as admin, then click on Preferences, then click on Skin, then down at the bottom change the dropdown menu from Sapphire or whatever to Custom.

Step 5. Trust, but Verify.
Browse your wiki a dozen times or so. Have friends browse it. Go to the library and browse it from there. Now log back into your hit log website, ie, hitslog.com in this case. After you login you should be able to get the statistics for your hit counter, and it will show you very basic information... like the OS, the browser, how many hits in the last 24 hours, last 7 days, how many hits total, etc. Not a whole lot of detail, but at least it's a counter!

Step 6. Edit these instructions if you have a better idea.
That's what wiki is all about. Until wikia integrates google analytics or whatever, we are on our own people!

(PS, if you could... have someone .. change the pass code on my luggage...)

Decora 00:35, 10 February 2009 (UTC)

Doing almost the same by JS
Adding this to MediaWiki:Monaco.js on your local wiki :  /// Free counter

function addCounter {   var sidebar = document.getElementById("102_wg");

if(sidebar == null) return;

var comboString = "  "; sidebar.innerHTML = sidebar.innerHTML + comboString;

}

addOnloadHook(addCounter); and this to MediaWiki:Monobook.js :  /// Free counter

function addCounter {   var sidebar = document.getElementById("p-navigation");

if(sidebar == null) return;

var comboString = "  "; sidebar.innerHTML = sidebar.innerHTML + comboString;

}

addOnloadHook(addCounter); The placement of the image can seems not so good but it's the best i could do for now.

This has been implemented on fr.guildwars — TulipVorlax 07:05, 10 February 2009 (UTC)


 * Wooaaa ! People are actually visiting my wiki ! Lol.
 * I think we can use the same image for more than one wiki. I'll add it the fr.3d right away. — TulipVorlax 07:10, 10 February 2009 (UTC)


 * This is so COOL ! I can see wich pages people are visiting... — TulipVorlax 07:45, 10 February 2009 (UTC)


 * I updated the Monaco code because it was interfering with the "popup" menu. Now the tracker image appear just below the spotlight at bottom of left column.
 * If Wikia staff would care to help find a better placement i would be really gratefull. The ideal placement would be somewhere around id="wikia_footer"... — TulipVorlax 08:10, 10 February 2009 (UTC)


 * I managed to add some space (and an horizontal rule) between the actual spotlight and the tracker image. So it's really better now on Monaco. If it's ok with Wikia, it's will stay that way. — TulipVorlax 08:33, 10 February 2009 (UTC)