0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/ghost/tinybird
Hannah Wolfe 79e5991ac2
Fixed Tinybird KPI results (#21914)
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](ad1efb766e/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)
2024-12-18 16:59:24 +00:00
..
datasources Added versioning to all tinybird resources (#21794) 2024-12-03 17:11:37 +00:00
pipes Fixed Tinybird KPI results (#21914) 2024-12-18 16:59:24 +00:00
scripts Fixed tinybird tests with versioning (#21849) 2024-12-10 13:04:24 +00:00
tests Fixed Tinybird KPI results (#21914) 2024-12-18 16:59:24 +00:00
.tinyenv
README.md
requirements.txt

Tinybird

This folder contains configuration for Tinybird, so that the stats feature can be used.

We sync this configuration with Tinybird via the Tinybird CLI.

Tinybird CLI

The Tinybird CLI is used via Docker.

yarn tb

Documentation for the Tinybird CLI: https://docs.tinybird.co/v/0.22.0/cli/overview Note: you can use python if you prefer, but we use Docker for consistency.

How to work with version control: https://docs.tinybird.co/v/0.22.0/guides/version-control