added some analytics code