Piwik tags
Piwik is a great analytics program that competes with Google Analytics. It’s got great statistics and graphs and is being actively developed. There are hooks for plugins, and an API for getting output statistics.
However, it doesn’t have a working <noscript></noscript> for when javascript is disabled. This PHP script creates it. Merely put it in your piwik directory and include it. Then run piwik_tag(‘Your page title’); or if you have more than one website, piwik_tag(‘Your page title’,2); where 2 is your website’s ID in piwik.
Ideally this would be integrated right into piwik, but the problem is getting the proper page title programmatically. This is key to tracking, and is done automatically by javascript. I suppose someone could code output buffering and grab the page title that way, but there’s a performance penalty.
Grab the piwik_tag code here.
Note that you can simplify the code to just use a tracking image. This will avoid javascript altogether. However, this means losing piwik’s ability to:
- Track downloads
- Track outgoing links
- Track time on page
- (and probably a few other nifty statistics)
No Comments
Idiot-Proofed Revolution Theme
I’m very impressed with Jason Schuller’s Revolution Office Theme. See the demo. But since my clients aren’t that technical, I found it’s not quite ready for prime time.
(Note that I don’t think my clients are idiots – they’re actually unbelievably brilliant. They chose me, didn’t they? By Idiot-Proofed, I’m referring to the “WordPress for Idiots” type idiot, not stupid idiot, thank-you-very-much!)
Anyway, to make Revolution Office just a bit easier to use, I changed a few things in the backend.
First, I changed the small front page blurbs to use pages instead of posts. Most people using a CMS want to use pages for pages, posts are for blogs.
Second, I added some code to allow the pages to show “Read more…” just like a wordpress post. This allows the user to add small starter blurbs on the front page, then if the reader is interested, they can click for more. Note that this works ONLY for the front page. Inserting the WordPress “more” tag in a page will do nothing if it’s not the front page.
The above two changes will help the theme perform better as a CMS theme. Pages are best used for websites/CMS, posts make the most sense when used solely for blogs.
Third, I added code to list the actual pages/categories, instead of having the user find them using the Reveal IDs plugin. This lets you skip a couple steps and avoids mistakes. No need to go looking for anything – the pages/categories are listed right there in the options page.
Almost all of the needed changes are to function.php. Download the update here and rename it to functions.php. Also, you must change all “p=” query_post entries to “page_id=”.
If you find any problems, please leave a comment.
Anyway, thanks, Jason. Hope you find the code helpful enough to include in future updates.