Commit Graph

5 Commits

Author SHA1 Message Date
Hannah Wolfe
4b1ce62ca9
Fix origin attribution in Tinybird analytics hits (#21187)
closes 
https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- Atttribute the referral of the first hits to the whole session in `analytics_sources_mv`, while keeping the raw hits in `analytics_hits`
- Updated tests accordingly
- This is a rebased / reordered version of https://github.com/TryGhost/Ghost/pull/21166

Co-authored-by: alejandromav <hi@alejandromav.com>
Co-authored-by: Alejandro Martin <alejandromav@tinybird.co>
2024-10-02 17:27:43 +01:00
Hannah Wolfe
f082ba68e0 Added tinybird tests for filtering
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- This adds a set of tests to describe what the data should look like when we filter on various values
- We have tests for source and browser which are pulled from different MVs
- The result files are generated using ./scripts/gen_test_results.sh, and then manually verified
- We know they are not yet fully correct
2024-10-02 17:04:24 +01:00
Hannah Wolfe
60443726c9 Fixed tinybird test fixture data
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- This fixes the test data so that the session first hit and subsequent hits are in chronological order
- It also makes sure there isn't more than 30 minutes between hits, as our tracking script is only designed to keep sessions alive for 30 minutes so the data wasn't realistic
- NOTE: This data was generated by a script https://gist.github.com/ErisDS/25bb36f38d4c5a3f01d86f34ea5be707 - which didn't take these things into account

Co-authored-by: alejandromav <hi@alejandromav.com>
2024-10-02 17:04:24 +01:00
Hannah Wolfe
7ebb208549 Fixed browser/device missing data in tinybird
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- The top browser and device endpoints were pulling from the sources MV, that is filtered to not have same-source traffic
2024-09-27 14:30:42 +01:00
Hannah Wolfe
606fcbabe7 Added a set of tests for our tinybird setup
- TODO: make these run in CI
- Right now you run them by running `yarn tb` and then `./script/branch_and_test.sh`
- These are snapshot tests that check we get the desired result

Co-authored-by: alejandromav <hi@alejandromav.com>
2024-09-27 14:30:42 +01:00