Need BigQuery SQL query to collect time on page from Google Analytics data
<p>can anyone help with a BIgQuery SQL query to extract the time on page for a specific page from Google Analytics data please?</p>

<p>For every visitorId who has visited a particular page I would like the time on page for that page. This is so that I can calculate the median time on page rather than the mean. </p>

<p>I'm assuming that the visitorId, hits.hitsNumber and hits.time dimensions will be needed. Also that somehow the hits.time for the hit where the page was viewed will need to be subtracted from the hits.time of the following hit.</p>

<p>Any help much appreciated.</p>