Updated counter code: click map, hash change, etc.