Fix Referrer URL in tracking
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
- Enable snowplow micro by following this guide
- Enable Feature flag inside rails console.
rails c
Feature.enable('mask_page_urls')
Current Behaviour
- Open any page inside project/group. For example, http://localhost:3000/flightjs/Flight/activity
- Delete
gl-snowplow-pseudonymized-urls
key from local storage.
-
Go to any other page. For example, http://localhost:3000/flightjs/Flight/-/issues
-
Check snowplow page view api call,
refr
field url is not masked (group and project names are shown.)
Expected Behaviour After this MR
-
Follow all the steps from current behaviour.
-
refr
field in the payload should be from masked.
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
- Go to any page. http://localhost:3000/flightjs/Flight/activity
- Without deleting localStorage key go to another page. http://localhost:3000/flightjs/Flight/-/issues
- Verify that refr field is masked.
Related to #460265
Edited by Ankit Panchal