Skip to content

Funnel persons per step and dropoff #4883

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

Merged
merged 47 commits into from
Jun 29, 2021
Merged

Conversation

EDsCODE
Copy link
Collaborator

@EDsCODE EDsCODE commented Jun 25, 2021

Changes

Please describe.

  • pointed at Funnel step query new #4851
  • add ability to get persons by specific dropoff or step
  • the api will accept a funnel_step parameter that specifies the step at which you want the list of persons. Indexing starts at 1 so 1 = first step, 2 = second step, etc. The dropoffs are denoted by negatives so the people that dropped off from the first to second step would be -2, dropoffs from second to third step would be -3, etc.
    If this affects the frontend, include screenshots.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious
  • Frontend/CSS is usable at 320px (iPhone SE) and decent at 360px (most phones)
  • Breaking changes are backwards-compatible. Ensure old/new frontend requests work with new/old backends, and vice versa.

buwilliams and others added 30 commits June 18, 2021 08:48
…ed funnel_persons and funnel_trends_persons into individual classes;
…com:PostHog/posthog into funnel-persons-pagination-conversion-window
Base automatically changed from funnel-step-query-new to master June 28, 2021 14:20
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4883 June 28, 2021 21:06 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4883 June 28, 2021 21:07 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4883 June 28, 2021 23:10 Inactive
@EDsCODE EDsCODE requested review from neilkakkar and Twixes June 28, 2021 23:17
@@ -1,15 +1,31 @@
from ee.clickhouse.queries.funnels.base import ClickhouseFunnelBase
from ee.clickhouse.sql.funnels.funnel import FUNNEL_PERSONS_SQL
from ee.clickhouse.sql.funnels.funnel import FUNNEL_PERSONS_BY_STEP_SQL
from posthog.models import Person


class ClickhouseFunnelPersons(ClickhouseFunnelBase):
def get_query(self, format_properties):
Copy link
Contributor

Choose a reason for hiding this comment

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

Small refactoring note for the future (not necessary for now, but for when we move FunnelNew->Funnel):

It seems to me like format_properties are not generic enough anymore to warrant a place in the basic get_query signature? maybe it's worth every query generating its own properties that it needs.

For example, here it's a bit confusing that offset is missing, but turns out it comes from format_properties, and is literally equal to self._filters.offset - which seems to be the only thing being used

@EDsCODE EDsCODE temporarily deployed to posthog-pr-4883 June 29, 2021 15:32 Inactive
@Twixes Twixes linked an issue Jun 29, 2021 that may be closed by this pull request
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4883 June 29, 2021 16:03 Inactive
@EDsCODE EDsCODE merged commit 562e3ba into master Jun 29, 2021
@EDsCODE EDsCODE deleted the funnel-persons-per-step-and-dropoff branch June 29, 2021 16:22
@liyiy liyiy mentioned this pull request Jul 1, 2021
7 tasks
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.

Funnels - API for getting persons on a step or drop-off
4 participants