This explains how I added stats to my blog page.
You didn't ask, but let me tell you I learned a lot of maths over at KhanAcademy.