diff options
Diffstat (limited to 'app/assets/javascripts/design_management/utils')
-rw-r--r-- | app/assets/javascripts/design_management/utils/tracking.js | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/app/assets/javascripts/design_management/utils/tracking.js b/app/assets/javascripts/design_management/utils/tracking.js index 39c20376271..b3ecc1453a6 100644 --- a/app/assets/javascripts/design_management/utils/tracking.js +++ b/app/assets/javascripts/design_management/utils/tracking.js @@ -1,18 +1,9 @@ import Tracking from '~/tracking'; -function assembleDesignPayload(payloadArr) { - return { - value: { - 'internal-object-refrerer': payloadArr[0], - 'design-collection-owner': payloadArr[1], - 'design-version-number': payloadArr[2], - 'design-is-current-version': payloadArr[3], - }, - }; -} - // Tracking Constants +const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_context/jsonschema/1-0-0'; const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design'; +const DESIGN_TRACKING_EVENT_NAME = 'view_design'; // eslint-disable-next-line import/prefer-default-export export function trackDesignDetailView( @@ -21,8 +12,16 @@ export function trackDesignDetailView( designVersion = 1, latestVersion = false, ) { - Tracking.event(DESIGN_TRACKING_PAGE_NAME, 'design_viewed', { - label: 'design_viewed', - ...assembleDesignPayload([referer, owner, designVersion, latestVersion]), + Tracking.event(DESIGN_TRACKING_PAGE_NAME, DESIGN_TRACKING_EVENT_NAME, { + label: DESIGN_TRACKING_EVENT_NAME, + context: { + schema: DESIGN_TRACKING_CONTEXT_SCHEMA, + data: { + 'design-version-number': designVersion, + 'design-is-current-version': latestVersion, + 'internal-object-referrer': referer, + 'design-collection-owner': owner, + }, + }, }); } |