Add UI to Product Analytics feature
What does this MR do?
This MR adds some basic UI to Product Analytics feature.
Details:
- Feature is behind the feature flag and is disabled by default.
- Events page is just landing page with last 20 events rendered there. In future 2 more pages with graphs will be added.
- The feature has
setup
page that tells user JS script they need to put in their application for tracking to work. - This feature has
test
page that creates a sample product analytics event (by simply rendering js tracker into the page). - Ships with
sp.js
file which is bundle of snowplow javascript tracker. Must be publicly accessible and persistent URL so in/public
.
Based on !27730 (closed).
Part of #225167 (closed)
Questions and answers
Q: How its different from existing snowplow integration?
A: Everything in https://docs.gitlab.com/ee/development/telemetry/snowplow.html is about tracking GitLab usage and see results somewhere. This MR is about tracking app usage somewhere and seeing results in GitLab.
Q: How to use this feature?
A: The flow is next:
- User creates project X on GitLab
- User visits product analytics > setup page and receives a JS snippet
- They put the snippet into their app (like you do with google analytics). Let's say
MyApp
. - Every time someone uses
MyApp
it executes the snippet. - The snippet loads JS code from
whatever.gitlab.instance/-/sp.js
. - The js code creates a tracking event and send it to
whatever.gitlab.instance/-/collector
. - User visits their GitLab project X again and see all events from
MyApp
in our UI.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
Edited by Dmytro Zaporozhets (DZ)