Skip to content

Fix Referrer URL in tracking

Ankit Panchal requested to merge 460265-referal-url-fix-tracking into master

What does this MR do and why?

This MR adds fallback if Referrer URL in tracking is not present.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Enable snowplow micro by following this guide
  2. Enable Feature flag inside rails console.
rails c
Feature.enable('mask_page_urls')
Current Behaviour
  1. Open any page inside project/group. For example, http://localhost:3000/flightjs/Flight/activity

Screenshot_2024-05-16_at_10.54.51_AM

  1. Delete gl-snowplow-pseudonymized-urls key from local storage.

Screenshot_2024-05-16_at_10.54.19_AM

  1. Go to any other page. For example, http://localhost:3000/flightjs/Flight/-/issues

  2. Check snowplow page view api call, refr field url is not masked (group and project names are shown.)

Screenshot_2024-05-16_at_10.58.24_AM

Expected Behaviour After this MR
  1. Follow all the steps from current behaviour.

  2. refr field in the payload should be from masked.

Screenshot_2024-05-16_at_10.56.12_AM

Please note that it works fine, if there is some data in localStorage and we do not delete local storage key gl-snowplow-pseudonymized-urls

  1. Go to any page. http://localhost:3000/flightjs/Flight/activity
  2. Without deleting localStorage key go to another page. http://localhost:3000/flightjs/Flight/-/issues
  3. Verify that refr field is masked.

Screenshot_2024-05-16_at_11.05.13_AM

Related to #460265

Edited by Ankit Panchal

Merge request reports