Zero page view counts pages in Behavior analytics dashboard
Summary
In the "Top pages table" in the Behavior Analytics Dashboard, multiple pages (or rather URL + query strings) are listed at 0 page views.
Steps to reproduce
Unclear. The project was instrumented using the Browser SDK with a minimal number of events (see also here) tracking page views.
Example Project
https://gitlab.com/gitlab-com/cs-tools/gitlab-cs-tools/what-is-new-since
What is the current bug behavior?
0 count page views are generated
What is the expected correct behavior?
Page views are correctly counted.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
This is caused by https://gitlab.com/gitlab-org/analytics-section/product-analytics/devkit/-/blob/main/cube/schema/TrackedEvents.js#L17-17. This produces the following SQL:
count(
CASE
WHEN (`tracked_events`.event = 'page_view') THEN `tracked_events`.event_id
END
) `tracked_events__page_views_count`
The issue here is that when an event
is not page_view
it returns a value of 0
for the case, which then means we're accidentally tracking page_ping
and unstruct
. We need to filter (add a WHERE
clause) by page_view
for this count to work correctly.
2️⃣
Implementation plan - - Update in-built visualizations YAML definitions to include the new filter.
- Update documentation to include the new filter.
- Update frontend to automatically apply the new filter in the visualization designer.
- Update test to include the new filter.