GROUP BY performance
Take a look at my answer here - you could take a similar query and use MySQL events (see here) to add rows to an aggregation table on an hourly basis - say at 5 minutes past the hour, perform a query for the previous hour's clicks and hits - that way you'd only be querying an hour at a time and I presume that the performance would be OK for a small subset of your results. Since it's logging you're doing, any logged data isn't going to change, so querying 1 hour at a time makes sense - i.e. (pseudocode) 

SELECT HOUR&lt;my_time_field&gt; AS Hour, &lt;my_aggregates&gt; 
FROM &lt;my_table&gt; 
WHERE MyTime 
BETWEEN (Now - 65mins) AND (Now-5mins);
GROUP BY Hour


Something like that might be a solution to your issue?