Tag Archive for 'statcounter'

08
Oct

Statcounter on my WordPress blog

statcounter graph of pageloads, unique visitors, and returning visitors

A few months ago I wrote about using Statcounter on a WordPress blog. I had originally hoped to find a plugin to help with this, but in the end I had to roll my own “plugin” to get the job done.

I’ve been using Statcounter to collect data on the usage of my blog/website for a little over a month now. It’s an awesome tool! The graph at the top of this article shows the number of pageloads (green), unique visitors (blue) and returning visitors (orange) over the last month or so. I had no idea this many folks were reading this crap. Get a life, people! ;) Seriously, though… The traffic image above is just a nice graphic. The real value of Statcounter is the analysis tools they provide for your visitor log. My favorites are the “Popular Pages” and “Keyword Analysis” tools. Popular Pages shows your most-frequently accessed pages, duh. Keyword Analysis shows the search engine keywords that people are using to find your site and most importantly what pages they’re choosing to view.

In fact, the reason for this post is an analysis I ran this morning. A fair number of people are searching for “statcounter wordpress” and landing on one or the other of the two pages I mentioned in the first paragraph of this article. Further analysis of the Visitor Paths (another handy tool) shows that many of those people aren’t finding both of those articles. I’m hoping that this article will get a slightly higher page rank than the other two, and search engine users will more easily find the information they’re looking for.

31
Aug

Footer plugin requirements, notes

A few days ago, Joseph and I were talking about bolting statcounter onto our blogs. He’s the one that pointed out statcounter to me, and all he needed to do was add the statcounter script to his theme’s footer.php file. This would probably work for any single-theme site, but I’m still running multiple themes on my blog. I need to do one of the following if I want to use statcounter:

  1. Drop all but one theme. There are several good reasons for this, most important of which is maintenance. This would allow me to add the statcounter script to the remaining theme’s footer.php and I’d be done.
  2. Add statcounter to all my themes. This probably wouldn’t be too bad, except for maintenance–whenever a new version of one of my themes came out, I’d have to manually reapply my changes.
  3. Write a plugin to insert the statcounter script in the footer of every page. This would be the most work up front, but it would give me a good excuse to learn how to write plugins for WordPress.

I found some useful resources for plugin authoring. The WordPress codex has a section on writing plugins. Owen’s tutorial is a great introduction–just read it and start hacking! :) Carthik’s Plunge into Plugins article has lots of good advice, but isn’t a tutorial–check it out after/while you get started with Owen’s page. More good info is available on the Codex page Writing a Plugin.

I’ve started working on this plugin, and I’ve already been bitten by the “extra blank line” problem. (Admin interface was reporting “Cannot modify header information - headers already sent by…” error. Note to self–scroll to the bottom of each PHP file, and make sure the PHP close tag is right at the bottom of the file.) I have the code to insert arbitrary text into the footer, but I still need to add the Options menu which would allow J. Random User to edit the text to be inserted. (Right now, the text is hard-coded in the “plugin”, which I have installed and activated on this blog. Check the bottom left corner of any blog page for the statcounter.)

I don’t see any reason for this plugin to be statcounter-specific. It would be more useful to provide some sort of generic footer plugin which would allow HTML or javascript to be inserted in the footer. We’ll see how it goes. If I’m happy with it by the end of the night or later this week, I will go ahead and release it.

08
Jul

Adding statcounter to WordPress

I’m thinking about using the free statcounter service on my site, but it requires that I add a little bit of javascript to each page. If I was running a single theme, I could probably find all the appropriate </body> tags and just paste in the statcounter code. But I’m trying to support multiple themes; besides, where’s the fun in cutting and pasting a bunch of code? Also, what if I need to change the statcounter code for some reason? So I think the Right Thing to do here is come up with a plugin for the wp_footer action which will insert some user-specified code, (in this case, my statcounter javascript). I haven’t found a plugin for statcounter, so I’ll be searching for a generic footer plugin. If I can’t find anything, I guess I’ll have to roll my own.




November 2008
M T W T F S S
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930

Tags

abramoff accessibility acetylene activism aerial photo afrofunk aim4tree air america airport express alite alito amtrak andante andy anti failure any browser apache apple applescript arden arcade arden park ariana arnold ashland astronomy attic attika audio avid reader backup baen bart bathroom bbq bee beef begonia bgg bike bike hikers bike journal bikejournal biketalk bill oreilly bittorrent blacklist blog bloggercode blogroll blueberry boardgamegeek boardgames bonjour book bookcrossing boot failure bootcamp borderline chaos bugmenot bush business card cabinetry caira caitlin california candamir caroline carpet cat cateye cdrom celebration cellular phone century cheese chicken chico chimney chinese chipotle chocolate christmas chumby city bikes civilization cjd claire club club fed co op coconut coffee comfort food community computer concord congress conquest conservation consumer reports copyright costco crazybikerchick crepe crock pot cruftbox css csus curl currency custard cvntrak dagoba daniel goetz darwinports datarescue date format death delicious monster democracy now Democrat demolition dessert dickens diff disaster discrimination discworld dishwasher diskwarrior dixie belle dock doors downing street memo drm dryer drywall dump ed burke eff eggs eject election electric car electric truck electrical electricity elvgren email energy efficiency eric meyer esr etext euthanasia facebook family faq faux news feed feedreader fence finder firefox first4internet first amendment fishmeal flash flickr flooring foreign exchange foundation fox and goose framing freebsd freedback fyq garage garden geek geotag geourl gnutar go gonuls google google earth google maps gpl gracenote graywater greek green group concat gtd gunthers gutters gwbush gymnastics hacking halloween handspring hardwood harry potter headmeta high speed photograph high tech inv hoax hobbies hobby hodgins holiday holly home power magazine horcrux houseblogs how to html humor hvac ilovejackdaniels impeach inspection insulation intel internet ipod ipodder iq iraq isight itunes ivins iwantsandy java city javascript joint chiefs joseph jott journalized blue judges cup kctc khs kimkerry kitchen kyocera la salles la times labor landscape laundry law leatherbys legal lego leopard lhc liberal library linkedin ljurban lodi logic logo lungren maaloufs mac macbook mailinator malware map marin markdown mason media media clip media reform meetup metric mexican microsoft mike comfort military milonic mindstorms mlk model railroading modoc hall monterey morning sedition motorcycle movie moving munchkin murray mushroom music mynetflix mysql naked lounge nerd score netflix network new urbanism new year New Yorker nofollow nutella oatmeal obama obcz occidental occupation omni openssl oracle organic osx owp paint pair palast palm panasonic parallels party patch peak adventures peak oil pear pedestrian village perl petaluma php ping pingback pingomatic pingomation pingqueue pirate pl sql planet bike plasma playroom entertainment plugin plugin:preview theme plugin:text control plugin:ultimate tag warrior plumbing podcast podsite politics portupgrade potato powerbook printer programming project gutenberg pryde punk puzzle qiana quilt quilt shop quiz quote r5 records racism radio railroad recent comments recipe redalt remodel resaurant resolution restaurant restore review richmond rio americano robotics roger niello ron montana roof rootkit rss sacbee sacog sacramento sacramento spotlight magazine salad san francisco sandwich santa cruz scam scandal school days scplugin security session report shakespeare shuffle sigma siriradha sitemap snl snopes social social network software soma somafab sonicchicken sonicchicken blog sony spam spam karma spellcheck spinach spirit spoiler etiquette spring hill cheese sql sqlserver stairs standards statcounter stephen king stop loss stucco stunt subversion sudoku superbowl superhero supreme court sushi svn sysadmin tacoma tags plugin takara technology telephone television template terms and conditions textcontrol thai kitchen thanksgiving theater theme theme:borderline chaos theme:elvgren theme:elvgren wordpress google code theme:fluid blue theme:fullwidth theme:head theme:journalized theme:journalized blue theme:psycho theme:redoable theme:sharepoint like theme:simple green theme:spirit theme:steam theme:wuhan theme:yadda theme switcher thomas tigris euphrates tile tinfoil hat toc tofu tower theater training transit transit oriented development tribute u haul uneasy rhetoric university village van zant veterans day video vie viking hobby vote smart w3c wall warboss washer washington post weather web web developer web server wikipedia windows wishlist woodworking wordpress workplace wpblacklist wpgatekeeper wsj yaaarr yard