set up function to log clicks on page