Analytics inherited classes, however Laura is right, Google Analytics does all of this and so much better than this code does!