Skip to content

Add BrowserSDK for page view tracking to Gitlab.com

Ankit Panchal requested to merge 415554-add-browser-sdk-analytics into master

What does this MR do and why?

Implements https://gitlab.com/gitlab-org/gitlab/-/issues/415554

Gitlab.com does not emit any page view data to Product Analytics collectors since the Browser SDK is not implemented. This MR adds browsersdk to instrument data for product analytics.

How to set up and validate locally

  1. Enable feature flag browsersdk_tracking
rais c
Feature.enable?(:browsersdk_tracking)

This feature will only be supported for Gitlab.com, so make sure you make Gitlab.com? method to true in lib/gitlab.rb and restart gdk.

  def self.com?
    true
  end
  1. Set up product analytics dashboard and set env variables of the collector url and app id OR enable snowplow micro locally and use that with any random appId.
export GITLAB_ANALYTICS_URL=http://localhost:9089
export GITLAB_ANALYTICS_ID=123
  1. Open ## What does this MR do and why?

Implements https://gitlab.com/gitlab-org/gitlab/-/issues/415554

Gitlab.com does not emit any page view data to Product Analytics collectors since the Browser SDK is not implemented. This MR adds browsersdk to instrument data for product analytics.

How to set up and validate locally

  1. Enable feature flag browsersdk_tracking
rais c
Feature.enable?(:browsersdk_tracking)

This feature will only be supported for Gitlab.com, so make sure you make Gitlab.com? method to true in lib/gitlab.rb and restart gdk.

  def self.com?
    true
  end
  1. Set up product analytics dashboard and set env variables of the collector url and app id OR enable snowplow micro locally and use that with any random appId.
export GITLAB_ANALYTICS_URL=http://localhost:9089
export GITLAB_ANALYTICS_ID=123
  1. Open any page locally and it should be sending page view event to product analytics collector host.

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 #415554

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 #415554

Edited by Ankit Panchal

Merge request reports