How to set up visitor analyzis on blogs.perl.org

Update

Apparently the admins of blogs.perl.org managed to close the JavaScript related security issue, which also disabled this solutions. I leave the article here for now but we cannot see the number of visitors this way. I hope a better solution will be implemented soon.

How to set up visitor analyzis on blogs.perl.org

On Saturday I posted a question How many people read your blog?
and included a GetClicky (affiliate) counter in the post. It showed me, about 150 people visited that page.

That was actually quite impressive. It was on a week-end when my other sites usually drop to 30-40% of their regular week-day traffic.

I think I'll experiment a bit with posts on blogs.perl.org but I'd like to get back to the subject in case you too would like to know how many people read your writings.

Which visitor analyzis system to use?

Google analytics is free and I am using it on most of my sites, but I am also using GetClicky (affiliate) which has a free version.
Actually I pay for it and I just upgraded to a 30-site account but unlike you, I am a stats freak :) I am sure there are other systems as well. Pick one that you like and get the code snippet from their system.

Then read on, how to embed it in your blog on blogs.perl.org:

How to set up visitor analyzis on blogs.perl.org

After logging in to blogs.perl.org, click on the Post menu item:

click_post.png

That leads you to the admin interface of Movable Type. In the Preferences menu click on the General sub-menu item:

preferences.png


Inside the General Settings editor insert the tracking code snippet in the Description field. This field holds the text that appears right under your name.
Click the Save Changes button:

general_settings.png

A new green message will appear above the editing area. Don't forget to click on the Publish link! Without that the code won't be inserted. (Maybe it will in future posts, but why not track how your old posts behave?)

publish.png

That's it. Now, if you visit your articles or your personal page on blogs.perl.org, the visits will show up - after a few second or minute delay - on the GetClicky panel.

What now?

Now you are trapped. After every post and between posts you will keep checking how did your writing do. Sorry for that.


Written by Gabor Szabo.

11 Comments

Hmm... It's probably a bug that Movable Type allows a user to insert arbitrary Javascript into what is intended to be a text field.

Thank you for drawing our attention to it :-)

I think that our solution will be in two phases:

1/ Prevent HTML in the description field.
2/ Add support for Google Analytics.

I'm not sure how soon either of those will happen (or in what order). I guess we'll report in more detail once we have a firm plan.

While I understand the need for security, being able to put an embed script for github gists has been nice and I would hate to see that removed. Certainly that is the site owners prerogative, but please keep that one in mind as you consider.

How to disable user tracking:


% sudo cat >> /etc/hosts
127.0.0.1 static.getclicky.com

:)

being able to put an embed script for github gists has been nice and I would hate to see that removed

Consider what you are really saying here. Effectively you prefer that your auth cookies can be stolen and your blog vandalised, just as long as you get to use Gist embeds… (Such holes have been exploited at PerlMonks. It is not a theoretical concern.)

(Another separate thing is: maybe it has been nice for you, but it is a pain in the neck to your feed subscribers. Because the code itself is no longer present in the entry text, all an aggregator shows is a big blank. Then to read the entry properly one has to click through. But that is only likely to result in the entry getting skipped. Only if you’ve set ablaze my interest by the first blank will it cross the inconvenience threshold.)

Bottom line is we need to fix our code highlighting script so people don’t feel as much of a need for Gist embeds. (Actually I would prefer for us to support Gist embeds directly and convert them to something sensible on submit. They do have some nicer features than what we would offer and I am not against them on principle. But to do what I want by hacking on Movable Type is… not likely.)

I think that our solution will be in two phases:

1/ Prevent HTML in the description field.
2/ Add support for Google Analytics.

I'm not sure how soon either of those will happen (or in what order). I guess we'll report in more detail once we have a firm plan.


Isn't there any plugin for blog statistics for movable type? For Wordpress there is something which does this and shows the numbers of visitors.

Anyway, if you allow image hotlinking it is easy to just hotlink an image into the blog and examine how many people are reading the page, without the need for JavaScript.

Woah! Calm down, I wasn't saying open the gates of hell just so long as I get to have my gists. I was asking for it if it can be done well and if not fine. And yes fixing the highlighting (and width handling) etc would be nice, but then again, this is free, version controlled and probably not a security concern of you allow scripts from that one source somehow.

I don't know web security nor to I pretend to. I hope those who do will do what they can to protect us from ourselves. However if its possible to use some of the nice/free features of the web while doing so securely, then that would be nice too. Thats all.

Did I really come off that angry? I wasn’t, nor was that a reprimand, don’t worry. People just tend not to like it when you take away something they enjoy, and we’re put in that position in this regard, which is no fun.

Unfortunately all of us on the b.p.o team only know to scratch the surface on Movable Type (which is a huge system with lots of moving parts), and the people we know who have such expertise have very little spare time, so that trivial-seeming problems persist for years and simple-seeming features cannot be added. It is a frustrating situation.

Well then I stand corrected in tone. Thanks for providing this platform, I'm glad we have it. Perhaps brushing it up could be a TPF grant idea?

Leave a comment

About Gabor Szabo

user-pic Perl author and trainer. Usually writing on other sites: Writing the Perl 5 Maven tutorial Perl 6 articles. Started a Perl IDE. Running the Weekly Perl newsletter. My personal blog.