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

feat(web-analytics): Allow customers to compare against a different period #26820

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rafaeelaudibert
Copy link
Member

@rafaeelaudibert rafaeelaudibert commented Dec 11, 2024

Changes

Right now, we'd always compare our data against the last period, i.e. if we're looking at the data from the last 14 days, then you'd always compare it against the previous 14 days.

This is not always ideal, as someone might want to compare against numbers from the same time last year.

We've added the comparator component in a previous commit (hidden behind a FF) and we're now actually using that data in the backend.

image

Does this work well for both Cloud and self-hosted?

Yep

How did you test this code?

  • Manual UI tests
  • Backend tests

@@ -882,6 +882,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
kind: NodeKind.WebExternalClicksTableQuery,
properties: webAnalyticsFilters,
dateRange,
compareFilter, // NOTE: Backend is not using this yet
Copy link
Member Author

Choose a reason for hiding this comment

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

@robbie-c Thoughts on whether this is actually helpful? Does it make sense to compare outbound link clicks? The backend doesn't compare it at all, it's always just current data

It's not hard to implement, but I'm trying to get a feeling here on how this could be helpful. I think it is, but I wanna hear from you.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think it is, but fine if we don't include it in this PR

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.11 MB

compressed-size-action

Base automatically changed from display-stats-from-conversion-goals-only-2 to master December 11, 2024 16:08
…eriod

Right now, we'd always compare our data against the last period, i.e. if we're looking at the data from the last 14 days, then you'd always compare it against the previous 14 days.

This is not always ideal, as someone might want to compare against numbers from the same time last year.

We've added the comparator component in a previous commit (hidden behind a FF) and we're now actually using that data in the backend.
Use same methods as we're using on `stats_table` to calculate previous metrics. We've extracted this up to `web_analytics_query_runner`
@rafaeelaudibert rafaeelaudibert force-pushed the implement-comparison-to-complex-past-period branch from 7164e68 to fd09fea Compare December 12, 2024 19:29
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member Author

Choose a reason for hiding this comment

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

Come on buddy, why do you keep disappearing 😮‍💨

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the implement-comparison-to-complex-past-period branch from 3413f94 to 18ca9a9 Compare December 12, 2024 21:19
@rafaeelaudibert rafaeelaudibert marked this pull request as ready for review December 12, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants