Skip to content

Updates cube data model for funnel analysis

Surabhi Suman requested to merge ss/update-funnel-schema into main

What does this MR do and why?

A change has been made to the dynamic funnels cube schema to update the underlying SQL query for funnel analysis. This change affects the data that is displayed in the funnel visualization right now.

MR acceptance checklist

  • The correct type labels have been applied to this MR.
  • This MR has been made as small as possible, to improve review efficiency and code quality.
  • This MR has been self-reviewed per the code review guidelines.
  • The changes have undergone manual testing and are functioning as intended.
  • This MR has updated the Chart.yaml version number following SemVer versioning practices.
  • This MR documents any breaking changes in the MR description, and the upgrade path has been documented in the first commit as well as in MR description.

How to set up and validate

  1. Pull from gitlab-org/gitlab!155290 (merged) and restart GDK to update the base SQL for funnels.

  2. Create a project in GDK and onboard it to product analytics with Data Sources pointing to a BYOC setup.

  3. Run helm upgrade with steps given in upgrade.md

  4. Create a new funnel for the project.

    name: Path Funnel
    seconds_to_convert: 3600
    steps:
      - name: view_page_1
        target: '/page1.html'
        action: 'pageview'
      - name: view_page_2
        target: '/page2.html'
        action: 'pageview'
      - name: view_page_3
        target: '/page3.html'
        action: 'pageview'
  5. Verify SQL saved in clickhouse by running

SELECT JSONExtractString(contents, 'schema') AS sql FROM ${appId}.funnel_schemas
WHERE name = 'path_funnel'
  1. Ensure newly created dynamic cube is reflected properly with measures and dimensions in /meta endpoint.

  2. Query newly created cube on /load endpoint with measures and dimensions and filter(optional) and verify if filtered data is correct.

    POST /api/v4/projects/{project_id}/product_analytics/request/load HTTP/1.1
    Host: localhost:3000
    Accept: */*
    Cookie: 
    content-type: application/json
    
    {
        "query": {
            "measures": [
                "path_funnel.count"
            ],  
            "dimensions": [
                "path_funnel.step"
            ]
        },
        "queryType": "multi"
    }

How to deploy upon merging

Numbered steps to explain how this change needs to be deployed. For instance, if there are any changes that should be made outside of the code changes themselves.

Related to #463491

Edited by Surabhi Suman

Merge request reports