Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-13 09:11:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-13 09:11:33 +0300
commit56a177ed56309f4742fe9f978adec394636bd7ca (patch)
tree22020565df5e956e880e1fa67c51bbf72965bf2b /app/assets/javascripts/tracking
parent4ae83df07e37b502c3b2fdbd352328d72f31d1f5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/tracking')
-rw-r--r--app/assets/javascripts/tracking/constants.js2
-rw-r--r--app/assets/javascripts/tracking/get_standard_context.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/tracking/constants.js b/app/assets/javascripts/tracking/constants.js
index 4753d483f15..2593fbe6ed1 100644
--- a/app/assets/javascripts/tracking/constants.js
+++ b/app/assets/javascripts/tracking/constants.js
@@ -25,3 +25,5 @@ export const LOAD_ACTION_ATTR_SELECTOR = '[data-track-action="render"]';
export const URLS_CACHE_STORAGE_KEY = 'gl-snowplow-pseudonymized-urls';
export const REFERRER_TTL = 24 * 60 * 60 * 1000;
+
+export const GOOGLE_ANALYTICS_ID_COOKIE_NAME = '_ga';
diff --git a/app/assets/javascripts/tracking/get_standard_context.js b/app/assets/javascripts/tracking/get_standard_context.js
index c318029323d..6014f1ba3ee 100644
--- a/app/assets/javascripts/tracking/get_standard_context.js
+++ b/app/assets/javascripts/tracking/get_standard_context.js
@@ -1,4 +1,5 @@
-import { SNOWPLOW_JS_SOURCE } from './constants';
+import { getCookie } from '~/lib/utils/common_utils';
+import { SNOWPLOW_JS_SOURCE, GOOGLE_ANALYTICS_ID_COOKIE_NAME } from './constants';
export default function getStandardContext({ extra = {} } = {}) {
const { schema, data = {} } = { ...window.gl?.snowplowStandardContext };
@@ -8,6 +9,7 @@ export default function getStandardContext({ extra = {} } = {}) {
data: {
...data,
source: SNOWPLOW_JS_SOURCE,
+ google_analytics_id: getCookie(GOOGLE_ANALYTICS_ID_COOKIE_NAME) ?? '',
extra: extra || data.extra,
},
};