Here’s a quick and dirty way to record some visitor stats. (this is based on the howto here) (I moved the looong text to a lj-cut on the suggestion of )

Before you start, you should decide how you are going to track the stats. Many free stat sites exist which will work fine with this method, and I won’t go into finding one of them. I’m using a quick custom php script I wrote. (requires mysql) I’ll provide the source to this, but it is quick and dirty and incomplete particularly in that it doesn’t have a method to report statistics yet. I’ll have something up soon to do that though. I’m going to continue this howto assuming you’re using my method. I’m also assuming you are using S2. Doing this in S1 should be much much easier, as you can just include the tag in the header override. I’ve only tried this with the Component style, but I think it will work with any S2 style. First, get lj_hit.php.src, rename it to lj_hit.php, and edit it to put the in username, password and database name. (look for the comment “CHANGE THESE THREE VARIABLES” near the top of the file) Then upload it to your webserver. Next, grab gss_sql.sql and execute it to create the mysql table. You can do this via phpmysqladmin by navagating to your database, clicking the SQL tab, and pasting in the SQL from gss_sql.sql.  At this point you should be able to hit lj_hit.php?pagename=testing and get a little tiny white image. If you get an error message check that you’ve followed my steps. If you can’t figure out what’s up you can post a comment and I’ll try to help. Next, you need to create a custom s2 layer and enable it. In this example I’m going to override print_free_text. First you need to be sure the free text component is enabled. Go to http://www.livejournal.com/customize/ and click edit or create customizations just under themes. On the layout pane, check Override default under Enable Free Text. Then change the dropdown box below to yes. You might need to scroll the page slightly for the dropdown box to show up in some browsers. Once that’s enabled, you can create your custom layer. To do this, go to http://www.livejournal.com/customize/advanced/ and click Your Layers. Under Create layout-specific layer, select Theme as the Type, and your layout as the Layout. (NOTE: If you are already applying a custom theme layer then you’ll want to edit instead) Next, click edit next to the layer you created. (or your current theme layer) Paste the contents of free-text.s2 into the box. (if you are editing your existing layer, be sure to leave off the first two lines of free-text.s2) Change the text USERNAME near the bottom right to your lj username. Click compile. Finally, you need to enable the layer. Go back to http://www.livejournal.com/customize/ and select your new theme from the themes dropdown. It will be called stats if you used the sample file. Click change. That’s it! You should see a wee little white box wherever the free text normally shows in your layout. Your normal free text will show up above it. You can make sure it is working by checking out the database. You should see a new row for each hit. If you have any questions feel free to contact me via AIM or leave a comment. I hope you found this useful!