Skip to content

Update audience dashboard and viz designer to support new session table

What does this MR do and why?

This MR updates the audience dashboard and visualization designer to support the new sessions table.

The new schemas use a materialized view to query sessions rather than the complex join we had originally to speed up query times and reduce timeouts.

To support this new schema we needed to make two material changes to the current audience dashboard and visualization designer:

  1. We needed to update the audience dashboard to use the new ReturningUsers schema which leverages the new sessions table rather than being part of the Sessions schema itself.
  2. We needed to update the visualization designer to create queries based upon the ReturningUsers schema and apply the required segment when ReturningUsers is used.

Screenshots or screen recordings

Before After
Screen_Recording_2023-11-06_at_14.19.27 Screen_Recording_2023-11-06_at_14.21.00

How to set up and validate locally

Note: Requires GitLab Ultimate

  1. Follow these instructions to set up Product Analytics in your GDK.
    • For those with the product analytics devkit already set up locally, please make sure you pull the latest copy of the main branch and rebuild your docker containers.
  2. Enable product analytics dashboards in your GDK:
    • echo "Feature.enable(:product_analytics_admin_settings)" | gdk rails c
    • echo "Feature.enable(:combined_analytics_dashboards)" | gdk rails c
    • echo "Feature.enable(:combined_analytics_visualization_editor)" | gdk rails c
  3. Enable product analytics and follow the set-up process to instrument your analytics instance.
  4. View the dashboards list at Project > Analytics > Analytics dashboards.
  5. Click on Visualization Designer button.
  6. Test the Sessions and Returning Users measures to validate the correct data is shown and no errors occur.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #426092 (closed)

Edited by Robert Hunt

Merge request reports