Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Average Scroll Depth Metric: handle missing data better #4889

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

RobertJoonas
Copy link
Contributor

Changes

  • Start ingesting missing scroll depth values as 255 (max UInt8) rather than 0 for pageleave events
  • Display "-" instead of 0 when no scroll depth data in range
  • Add a data migration setting scroll depth of pageleaves to 255 if it's 0

Reasoning:

A scroll depth of 0 currently represents a missing value, but it can also be a valid scroll depth in case of extremely short viewports and long documents. Also, 0's are currently counted towards average which we don't want to do in case of missing values

Tests

  • Automated tests have been adjusted

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

Copy link

github-actions bot commented Dec 9, 2024

Preview environment👷🏼‍♀️🏗️
PR-4889

@RobertJoonas RobertJoonas requested a review from macobo December 9, 2024 18:40
@@ -0,0 +1,18 @@
defmodule Plausible.DataMigration.MissingScrollDepth do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why is this a data migration not a normal one? Do we want to maintain it long-term?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just figured it's the preferred way of doing it since are no schema changes involved. When included in the normal migration pipeline, it would run every time when running migrations from scratch. Thought that would be unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to maintain it long-term?

Nope - we could also just run Plausible.DataMigration.MissingScrollDepth.run() in the remote shell and delete this file later on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note we could also just run the same sql directly in clickhouse, but will leave it up to you.

@RobertJoonas RobertJoonas added this pull request to the merge queue Dec 10, 2024
Merged via the queue into master with commit d21d485 Dec 10, 2024
9 checks passed
@RobertJoonas RobertJoonas deleted the scroll-depth-missing-values branch December 10, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants