added analytics code for #308
Merge pull request #317 from colkito/feature/analytics

added analytics code for #308