How do I determine bounce rate on my site?


Bounce rate refers to the percentage of single page visits (or sessions). That is, the number of visits in which a person leaves your website from the landing page without browsing any further. To calculate bounce rate, count the sessions in which the user viewed only one unique url and compare them to the total amount of sessions. Keep in mind that the query counts unique page_url which is a property automatically sent in the page_load sent from the CoolaData JS tracker. It could be replaced with your own custom property or with page_title.  

select sum(case when unique_pages =1 then 1 else 0 end) as single_page_sessions, count(*) as sessions,
(sum(case when unique_pages =1 then 1 else 0 end)/count(*))*100 as bounce_rate
(select session_id, count(distinct page_url) as unique_pages
from cooladata
where date_range(context)
and filters(context) 
group by session_id)