Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref https://linear.app/ghost/issue/ANAL-120/bounce-rate-data-seems-to-mix-units closes https://linear.app/ghost/issue/ANAL-119/visit-duration-metric-inaccurate closes https://linear.app/ghost/issue/ANAL-118/charts-are-empty-with-only-1-data-point - The original [web analytics starter kit KPI endpoint](https://github.com/tinybirdco/web-analytics-starter-kit/blob/ad1efb766e2bfbcc85d6c037cf23f02d36a2d0a1/tinybird/pipes/kpis.pipe#L122) had this simpler endpoint, but as I've messed around adding features, I've unintentionally overcomplicated it and introduced a tonne of bugs. - This reverts the KPI endpoint back towards the original structure, and moves all the calculations and where statements up to the data node - This means that the left join at the end works and pulls in all the dates from the timeseries node correctly, without the need for using `WITH FILL STEP 1` which generated a result for every second when looking at a single days data. - Moving the where clause handling up to the `data` node, rather than being on the endpoint still works as expected, which confused me when I first started working with tinybird - This should resolve several bugs we've experienced with the visit duration, with missing data points and empty charts, and perhaps even the bounce rate (but need to look at that more closely)
- Loading branch information