Commit b9c97f8e authored by Savas Vedova's avatar Savas Vedova

Merge branch 'nicolasdular/do-not-track-page-title' into 'master'

Do not track page titles via snowplow

See merge request gitlab-org/gitlab!74081
parents 799ea7f0 a5ef2da4
...@@ -46,7 +46,10 @@ export function initDefaultTrackers() { ...@@ -46,7 +46,10 @@ export function initDefaultTrackers() {
// must be after enableActivityTracking // must be after enableActivityTracking
const standardContext = getStandardContext(); const standardContext = getStandardContext();
const experimentContexts = getAllExperimentContexts(); const experimentContexts = getAllExperimentContexts();
window.snowplow('trackPageView', null, [standardContext, ...experimentContexts]); // To not expose personal identifying information, the page title is hardcoded as `GitLab`
// See: https://gitlab.com/gitlab-org/gitlab/-/issues/345243
window.snowplow('trackPageView', 'GitLab', [standardContext, ...experimentContexts]);
window.snowplow('setDocumentTitle', 'GitLab');
if (window.snowplowOptions.formTracking) { if (window.snowplowOptions.formTracking) {
Tracking.enableFormTracking(opts.formTrackingConfig); Tracking.enableFormTracking(opts.formTrackingConfig);
......
...@@ -397,6 +397,7 @@ Before you test frontend events in development, you must: ...@@ -397,6 +397,7 @@ Before you test frontend events in development, you must:
All URLs are pseudonymized. The entity identifier [replaces](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v2/tracker-setup/other-parameters-2/#Setting_a_custom_page_URL_and_referrer_URL) personally identifiable All URLs are pseudonymized. The entity identifier [replaces](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v2/tracker-setup/other-parameters-2/#Setting_a_custom_page_URL_and_referrer_URL) personally identifiable
information (PII). PII includes usernames, group, and project names. information (PII). PII includes usernames, group, and project names.
Page titles are hardcoded as `GitLab` for the same reason.
#### Snowplow Analytics Debugger Chrome Extension #### Snowplow Analytics Debugger Chrome Extension
......
...@@ -30,6 +30,7 @@ The [`StandardContext`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/g ...@@ -30,6 +30,7 @@ The [`StandardContext`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/g
Frontend events include a [web-specific schema](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/canonical-event/#Web-specific_fields) provided by Snowplow. Frontend events include a [web-specific schema](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/canonical-event/#Web-specific_fields) provided by Snowplow.
All URLs are pseudonymized. The entity identifier [replaces](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v2/tracker-setup/other-parameters-2/#Setting_a_custom_page_URL_and_referrer_URL) personally identifiable All URLs are pseudonymized. The entity identifier [replaces](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v2/tracker-setup/other-parameters-2/#Setting_a_custom_page_URL_and_referrer_URL) personally identifiable
information (PII). PII includes usernames, group, and project names. information (PII). PII includes usernames, group, and project names.
Page titles are hardcoded as `GitLab` for the same reason.
| Field Name | Required | Type | Description | | Field Name | Required | Type | Description |
|--------------------------|---------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------| |--------------------------|---------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------|
...@@ -105,7 +106,7 @@ information (PII). PII includes usernames, group, and project names. ...@@ -105,7 +106,7 @@ information (PII). PII includes usernames, group, and project names.
| `os_name` | **{dotted-circle}** | string | Name of operating system | | `os_name` | **{dotted-circle}** | string | Name of operating system |
| `os_timezone` | **{dotted-circle}** | string | Client operating system time zone | | `os_timezone` | **{dotted-circle}** | string | Client operating system time zone |
| `page_referrer` | **{dotted-circle}** | string | Referrer URL | | `page_referrer` | **{dotted-circle}** | string | Referrer URL |
| `page_title` | **{dotted-circle}** | string | Page title | | `page_title` | **{dotted-circle}** | string | To not expose personal identifying information, the page title is hardcoded as `GitLab` |
| `page_url` | **{dotted-circle}** | string | Page URL | | `page_url` | **{dotted-circle}** | string | Page URL |
| `page_urlfragment` | **{dotted-circle}** | string | Fragment aka anchor | | `page_urlfragment` | **{dotted-circle}** | string | Fragment aka anchor |
| `page_urlhost` | **{dotted-circle}** | string | Host aka domain | | `page_urlhost` | **{dotted-circle}** | string | Host aka domain |
......
...@@ -81,7 +81,8 @@ describe('Tracking', () => { ...@@ -81,7 +81,8 @@ describe('Tracking', () => {
it('should activate features based on what has been enabled', () => { it('should activate features based on what has been enabled', () => {
initDefaultTrackers(); initDefaultTrackers();
expect(snowplowSpy).toHaveBeenCalledWith('enableActivityTracking', 30, 30); expect(snowplowSpy).toHaveBeenCalledWith('enableActivityTracking', 30, 30);
expect(snowplowSpy).toHaveBeenCalledWith('trackPageView', null, [standardContext]); expect(snowplowSpy).toHaveBeenCalledWith('trackPageView', 'GitLab', [standardContext]);
expect(snowplowSpy).toHaveBeenCalledWith('setDocumentTitle', 'GitLab');
expect(snowplowSpy).not.toHaveBeenCalledWith('enableFormTracking'); expect(snowplowSpy).not.toHaveBeenCalledWith('enableFormTracking');
expect(snowplowSpy).not.toHaveBeenCalledWith('enableLinkClickTracking'); expect(snowplowSpy).not.toHaveBeenCalledWith('enableLinkClickTracking');
...@@ -130,7 +131,7 @@ describe('Tracking', () => { ...@@ -130,7 +131,7 @@ describe('Tracking', () => {
it('includes those contexts alongside the standard context', () => { it('includes those contexts alongside the standard context', () => {
initDefaultTrackers(); initDefaultTrackers();
expect(snowplowSpy).toHaveBeenCalledWith('trackPageView', null, [ expect(snowplowSpy).toHaveBeenCalledWith('trackPageView', 'GitLab', [
standardContext, standardContext,
...experimentContexts, ...experimentContexts,
]); ]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment