Added Google Analytics event tracking, which can be enabled from settings.
Removed useless code.