@skatofiabah, here is my SQL for the calculation. I break that into two for easy understanding.
The first one get time spent on each hit, no matter what hit type it is.
CREATE
OR REPLACE TEMP VIEW time_per_hit AS
select
date_time,
concat(
post_visid_high,
post_visid_low,
visit_num,
...